Bug 60687

Summary: Internal compiler error in subst_stack_regs_pat, at reg-stack.c: 1404
Product: [Retired] Red Hat Linux Reporter: Need Real Name <selinger>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-03-04 20:40:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2002-03-04 20:40:04 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2 i686)

Description of problem:
Reproducible bug occurs with -O2 or -O3 option. When compiling the short sample
program below, gcc-2.96-85 crashes with an "Internal compiler error". 

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Let gauss.c be this simple program:

#include <stdlib.h>

double gauss(void) {
  double r;

  r = rand()/(double)RAND_MAX;
}


2. gcc -O2 -c -o gauss.o gauss.c
 

Actual Results:  gauss.c: In function `gauss':
gauss.c:7: Internal compiler error in subst_stack_regs_pat, at reg-stack.c:1404
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


Expected Results:  it should have compiled just fine, like it does without "-O2"

Additional info:

Change the result type of the function gauss from "double" to "int" or "void",
and the bug goes away.

Comment 1 Jakub Jelinek 2002-03-05 16:34:08 UTC
This was fixed in 2.96-86 and above.