regehr@gamow tmp414]$ current-gcc -v Using built-in specs. COLLECT_GCC=current-gcc COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r160490-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../configure --with-libelf=/usr/local --enable-lto --prefix=/home/regehr/z/compiler-install/gcc-r160490-install --program-prefix=r160490- --enable-languages=c,c++ Thread model: posix gcc version 4.6.0 20100609 (experimental) (GCC) [regehr@gamow tmp414]$ current-gcc -c -O small.c small.c: In function 'func_21': small.c:42:22: warning: assignment makes integer from pointer without a cast [enabled by default] unhandled expression in get_expr_operands(): <error_mark 0x7fa3684399f0> small.c: In function 'int324': small.c:21:6: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:1020 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. [regehr@gamow tmp414]$ cat small.c static int foo (int si1, int si2) { return si1 > 0 && si2 > 0 && si1 > -si2 || si1 < 0 && si2 < 0 && si1 < -si2 ? : si1 + si2; } struct S0 { unsigned short f1; }; int g_4; struct S0 g_54 = { 3428 }; int func_21 (int * p_22, int * const int32p_24, unsigned p_25, const int * p_26); void int324 (unsigned p_15, int * p_16, int * p_17, int * p_18) { if (foo (g_4, func_21 (p_18, &g_4, 0, 0))) { for (g_54.f1; g_54.f1; g_54.f1 += 1) { } } } int func_21 (int * p_22, int * const int32p_24, unsigned p_25, const int * p_26) { for (0; 1; p_25 += 1) lbl_29:if (p_25) goto lbl_28; lbl_28:for (p_25 = 0; p_25 < 9; p_25 += 1) if (p_25) goto lbl_29; unsigned short l_53; for (0; l_53; l_53 = foo) { } return 0; }
It is caused by revision 160124: http://gcc.gnu.org/ml/gcc-cvs/2010-06/msg00036.html
Testing fix.
Subject: Bug 44485 Author: hubicka Date: Sat Jun 12 12:43:02 2010 New Revision: 160659 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160659 Log: PR tree-optimize/44485 * tree-cfgcleanup.c (fixup_noreturn_call): Remove basic blocks containing use of return value of noreturn function. * gcc.c-torture/compile/pc44485.c: New testcase. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pc44485.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-cfgcleanup.c
I am not sure if that's related, but the testcase fails with -O -funsafe-loop-optimizations in r160687/x86_64-linux: $ /mnt/svn/gcc-trunk/binary-160687-lto-fortran-checking-yes-rtl/bin/gcc -O1 -funsafe-loop-optimizations pc44485.c pc44485.c: In function 'func_21': pc44485.c:42:22: warning: assignment makes integer from pointer without a cast [enabled by default] pc44485.c: In function 'int324': pc44485.c:21:6: internal compiler error: in execute_todo, at passes.c:1285 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Is the name of the testcase, pc44485.c, a typo, or is the 'c' intentional?
Probably related. Honza?
The problem is that func_21 is first marked as TREE_READONLY/DECL_LOOPING_CONST_OR_PURE_P by local_pure_const, thus there are no vops on it, but afterwards it is by another local_pure_const made also TREE_THIS_VOLATILE (i.e. noreturn). flags_from_decl_or_type doesn't set ECF_CONST for const noreturn functions though for some reason: 603 /* Process the pure and const attributes. */ 604 if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp)) 605 flags |= ECF_CONST; 606 if (DECL_PURE_P (exp)) 607 flags |= ECF_PURE; (strangely it does set ECF_PURE for pure noreturn calls), which means when fixup_noreturn_call calls update_stmt to drop lhs from the call, it adds vops that were missing before and .MEM needs renaming, but the pass in which fixup_noreturn_call is called doesn't expect that ssa needs updating. I wonder what is the reason for that " && ! TREE_THIS_VOLATILE (exp)" above.
(In reply to comment #6) > The problem is that func_21 is first marked as > TREE_READONLY/DECL_LOOPING_CONST_OR_PURE_P by local_pure_const, thus there are > no vops on it, but afterwards it is by another local_pure_const made > also TREE_THIS_VOLATILE (i.e. noreturn). > flags_from_decl_or_type doesn't set ECF_CONST for const noreturn functions > though for some reason: > 603 /* Process the pure and const attributes. */ > 604 if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp)) > 605 flags |= ECF_CONST; > 606 if (DECL_PURE_P (exp)) > 607 flags |= ECF_PURE; > (strangely it does set ECF_PURE for pure noreturn calls), which means when > fixup_noreturn_call calls update_stmt to drop lhs from the call, it adds vops > that were missing before and .MEM needs renaming, but the pass in which > fixup_noreturn_call is called doesn't expect that ssa needs updating. > I wonder what is the reason for that " && ! TREE_THIS_VOLATILE (exp)" above. I'd say remove it - it probably was a measure to avoid DCEing the side-effect or so, before we had proper looping-pure-or-const.
Subject: Bug 44485 Author: jakub Date: Thu Aug 26 16:39:26 2010 New Revision: 163568 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163568 Log: PR tree-optimization/44485 * calls.c (flags_from_decl_or_type): For const or pure noreturn functions return ECF_LOOPING_CONST_OR_PURE|ECF_NORETURN together with ECF_CONST resp. ECF_PURE. * builtins.c (expand_builtin): Use flags_from_decl_or_type instead of querying flags directly. * tree-ssa-loop-niter.c (finite_loop_p): Likewise. * tree-ssa-dce.c (find_obviously_necessary_stmts): Likewise. * gcc.dg/pr44485.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr44485.c Modified: trunk/gcc/ChangeLog trunk/gcc/builtins.c trunk/gcc/calls.c trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-dce.c trunk/gcc/tree-ssa-loop-niter.c
Should be fixed now.
*** Bug 260998 has been marked as a duplicate of this bug. *** Seen from the domain http://volichat.com Page where seen: http://volichat.com/adult-chat-rooms Marked for reference. Resolved as fixed @bugzilla.