Bug 37931 - [4.4 Regression] ice: verify_gimple failed
Summary: [4.4 Regression] ice: verify_gimple failed
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-28 02:37 UTC by John Regehr
Modified: 2008-10-28 10:38 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2008-10-28 07:54:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Regehr 2008-10-28 02:37:42 UTC
regehr@john-home:~/volatile/tmp52$ current-gcc -O0 small.c
small.c: In function ‘func_1’:
small.c:5: error: type mismatch in binary expression
unsigned int

unsigned int

int

D.1241 = D.1240 & l_288;

small.c:5: error: type mismatch in binary expression
unsigned int

unsigned int

int

D.1242 = D.1241 | 1;

small.c:5: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

regehr@john-home:~/volatile/tmp52$ cat small.c

unsigned int div_rhs (int rhs)
{
  return 0;
}

int func_1 (void)
{
  int g_268 = 0;
  int l_288 = 0;
  int l_266 = 0;
  return (l_288 | l_266 == l_266) & (div_rhs (1) | 1);
}

regehr@john-home:~/volatile/tmp52$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20081027 (experimental) (GCC)
Comment 1 Jakub Jelinek 2008-10-28 07:47:39 UTC
Smaller testcase:
int
foo (void)
{
  int a = 0, b = 0;
  unsigned int c = 0;
  return (a | b == b) & (c | 1);
}
Comment 2 Jakub Jelinek 2008-10-28 07:54:17 UTC
Even smaller:
int a;
unsigned int b;

int
foo (void)
{
  return (a | 1) & (b | 1);
}
Comment 3 Jakub Jelinek 2008-10-28 10:36:15 UTC
Subject: Bug 37931

Author: jakub
Date: Tue Oct 28 10:34:51 2008
New Revision: 141406

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141406
Log:
	PR middle-end/37931
	* fold-const.c (distribute_bit_expr): Convert common, left and
	right arguments to type.

	* gcc.c-torture/execute/pr37931.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr37931.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Jakub Jelinek 2008-10-28 10:38:38 UTC
Fixed.