With current trunk (r140043) on powerpc (but not on x86_64): (sid)2492:tbm@test: ..4.3-2008-09-05-r140043/gcc] ./cc1 -quiet -O2 ~/gap-costab.i ../../src/costab.c: In function 'FuncStandardizeTable2C': ../../src/costab.c:2780: internal compiler error: in extract_range_from_binary_expr, at tree-vrp.c:2145 Please submit a full bug report, with preprocessed source if appropriate.
Created attachment 16235 [details] Preprocessed code
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */ typedef long int Int; typedef Int **Bag; FuncMakeConsequencesPres (Bag self, Bag list) { Bag objDefs1; Bag objDefs2; if (! ( (((Int) 0) + 13) <= (((Int) (objDefs1) & 0x01) ? ((Int) 0) : (((Int) (objDefs1) & 0x02) ? ((Int) 0) : *(*(objDefs1) ))) && (((Int) (objDefs1) & 0x01) ? (((Int) 0) ) : (((Int) (objDefs1) & 0x02) ? (((Int) 0) ) : (*(*(objDefs2) - 3) & 0xFFL))) <= 0)) ErrorQuit (); }
Further reduced testcase: typedef long int Int; void FuncMakeConsequencesPres (long *objDefs1) { long a = (long)objDefs1; int c = a & 0x01; int b = 0; if (! ( 13 <= ( c ? 0 : (((int) objDefs1 & 0x02) ? 0 : *objDefs1 )) && b <= 0)) ErrorQuit (); } --- CUT --- ifcombine causes the invalid IR to show up: D.1597_10 = objDefs1_1(D) & 3B; objDefs1 is a pointer.
Mine.
Subject: Bug 37387 Author: rguenth Date: Tue Sep 9 10:05:49 2008 New Revision: 140142 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140142 Log: 2008-09-09 Richard Guenther <rguenther@suse.de> PR tree-optimization/37387 * tree-ssa-ifcombine.c (ifcombine_iforif): Convert the name and bits to a common type. * gcc.c-torture/compile/pr37387.c: New testcase. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr37387.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-ifcombine.c
Fixed.