Bug 22311 - [4.0/4.1 Regression] internal compiler error: in c_common_type (-fshort-enums)
Summary: [4.0/4.1 Regression] internal compiler error: in c_common_type (-fshort-enums)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.2
Assignee: Joseph S. Myers
URL:
Keywords: ice-on-valid-code, monitored
Depends on:
Blocks:
 
Reported: 2005-07-05 15:50 UTC by Christophe Monat
Modified: 2005-08-01 01:40 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 3.4.0
Known to fail: 4.0.0 4.1.0
Last reconfirmed: 2005-07-31 22:57:37


Attachments
Preprocessed input file to reproduce bug (72.35 KB, application/octet-stream)
2005-07-05 15:52 UTC, Christophe Monat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Monat 2005-07-05 15:50:59 UTC
$  /apa/gnu/Linux-RH-7.2/gcc/gcc-4.0.0/bin/gcc  -O3 -march=pentium4 -mfpmath=sse
-fomit-frame-pointer -ffast-math -std=c99 -fshort-enums -Wall -Wno-unused
BlockRegion.i
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/lao/PFA/BlockRegion.xcc:
In function 'BlockRegion_findInvariants':
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/lao/PFA/BlockRegion.xcc:1017:
internal compiler error: in c_common_type, at c-typeck.c:531
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Christophe Monat 2005-07-05 15:52:49 UTC
Created attachment 9207 [details]
Preprocessed input file to reproduce bug
Comment 2 Andrew Pinski 2005-07-05 16:04:30 UTC
Confirmed, reduced testcase:
typedef enum {
  IssueItemFlag_Discard = 0x1
} IssueItemFlag;
void
BlockRegion_findInvariants(IssueItemFlag invariant, unsigned char a)
{
  a |= invariant;
}

Only -fshort-enums is needed to reproduce the bug.
Comment 3 Joseph S. Myers 2005-07-31 22:57:37 UTC
Testing a patch.
Comment 4 GCC Commits 2005-08-01 01:29:12 UTC
Subject: Bug 22311

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jsm28@gcc.gnu.org	2005-08-01 01:29:07

Modified files:
	gcc            : ChangeLog c-typeck.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: pr22311-1.c 

Log message:
	PR c/22311
	* c-typeck.c (build_binary_op): Use common_type wrapper on
	shortened types.
	(common_type): Update comment.
	
	testsuite:
	* gcc.dg/pr22311-1.c : New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9619&r2=2.9620
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.472&r2=1.473
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5861&r2=1.5862
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr22311-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 5 GCC Commits 2005-08-01 01:34:22 UTC
Subject: Bug 22311

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	jsm28@gcc.gnu.org	2005-08-01 01:34:14

Modified files:
	gcc            : ChangeLog c-typeck.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: pr22311-1.c 

Log message:
	PR c/22311
	* c-typeck.c (build_binary_op): Use common_type wrapper on
	shortened types.
	(common_type): Update comment.
	
	testsuite:
	* gcc.dg/pr22311-1.c : New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.343&r2=2.7592.2.344
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.419.2.10&r2=1.419.2.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.313&r2=1.5084.2.314
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr22311-1.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1

Comment 6 Andrew Pinski 2005-08-01 01:40:55 UTC
Fixed.