Bug 191963

Summary: ICE related to unsigned int with high bit set and floor()
Product: [Fedora] Fedora Reporter: Matt Davey <mcdavey>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: gcc-4.1.0-15.fc5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-05-17 09:03:47 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:
Attachments:
Description Flags
Example code that triggers internal compiler error none

Description Matt Davey 2006-05-16 16:14:29 UTC
Description of problem:
GCC internal compiler error

Version-Release number of selected component (if applicable):
gcc-4.1.0-3
glibc-headers-2.4-4

How reproducible:
completely

Steps to Reproduce:
1. save attached code to foo.c
2. compile with "gcc -O2 -c foo.c" on a 32-bit platform
  
Actual results:
Failure to produce .o file.  Instead, error report:
/tmp/foo.c: In function 'main':
/tmp/foo.c:9: internal compiler error: in get_callee_fndecl, at tree.c:5846

Expected results:
production of object file.

Additional info:
This bug is dependent on several things:
1. If optimisation is turned off, the bug disappears.
2. The bug occurs if (and only if) the (unsigned) integer constant
   has its high bit set.
3. If the call to 'floor' is replaced with a call to foo, with
   prototype "double foo(double d);", the bug disappears.  Perhaps
   the bug is related to some internal floor() implementation.

Comment 1 Matt Davey 2006-05-16 16:14:29 UTC
Created attachment 129220 [details]
Example code that triggers internal compiler error

Comment 2 Matt Davey 2006-05-16 16:18:26 UTC
Comment on attachment 129220 [details]
Example code that triggers internal compiler error

#include<math.h>

int main(int argc, char **argv)
{
	double d;
	unsigned int i = 0x80000000;

	d = i;
	i = (unsigned int)floor(d);
	return i;
}

Comment 3 Jakub Jelinek 2006-05-17 09:03:47 UTC
This is fixed in gcc-4.1.0-15.fc5 (currently FC5 testing updates).