Bug 38807 - [4.4 regression] ice: gimple check: expected gimple_assign(error_mark), have gimple_phi()
Summary: [4.4 regression] ice: gimple check: expected gimple_assign(error_mark), have ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 4.4.0
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-11 20:15 UTC by John Regehr
Modified: 2009-01-12 11:14 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: 2009-01-11 20:21:44


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Regehr 2009-01-11 20:15:07 UTC
Seen using r143243 on Ubuntu Hardy on x86.

regehr@john-home:~/volatile/tmp121$ current-gcc -O2 small.c
small.c: In function ‘foo’:
small.c:16: internal compiler error: gimple check: expected gimple_assign(error_mark), have gimple_phi() in gimple_assign_rhs1, at gimple.h:1729
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

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

int baz (short x)
{
  return x;
}

int g_2;
int g_10;

int bar (int p_7)
{
  if (baz (g_2 ^ p_7 ^ g_2))
    return g_10;
  return 0;
}

int foo (void)
{
  return bar (g_2 == 0 || 1 == 1 - g_2) ? 1 : bar (1 && g_2);
}

regehr@john-home:~/volatile/tmp121$ 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 : (reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion
Thread model: posix
gcc version 4.4.0 20090110 (experimental) (GCC)
Comment 1 Jakub Jelinek 2009-01-11 20:21:43 UTC
Mine, remove_visited_stmt_chain was added by me.
Comment 2 Jakub Jelinek 2009-01-12 11:11:53 UTC
Subject: Bug 38807

Author: jakub
Date: Mon Jan 12 11:11:40 2009
New Revision: 143289

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143289
Log:
	PR tree-optimization/38807
	* tree-ssa-reassoc.c (remove_visited_stmt_chain): Don't look at
	gimple_visited_p unless stmt is GIMPLE_ASSIGN.

	* gcc.c-torture/compile/pr38807.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr38807.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-reassoc.c

Comment 3 Jakub Jelinek 2009-01-12 11:14:28 UTC
Fixed.