Bug 191963 - ICE related to unsigned int with high bit set and floor()
Summary: ICE related to unsigned int with high bit set and floor()
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 5
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-16 16:14 UTC by Matt Davey
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: gcc-4.1.0-15.fc5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-05-17 09:03:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Example code that triggers internal compiler error (141 bytes, text/plain)
2006-05-16 16:14 UTC, Matt Davey
no flags Details

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).


Note You need to log in before you can comment on or make changes to this bug.