Summary: | [4.6 Regression] ICE in get_expr_operands, at tree-ssa-operands.c:1020 | ||
---|---|---|---|
Product: | gcc | Reporter: | John Regehr <regehr> |
Component: | tree-optimization | Assignee: | Jan Hubicka <hubicka> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | chenyang, gcc-bugs, hubicka, zsojka |
Priority: | P3 | ||
Version: | 4.6.0 | ||
Target Milestone: | 4.6.0 | ||
Host: | x86_64-unknown-linux-gnu | Target: | x86_64-unknown-linux-gnu |
Build: | x86_64-unknown-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: | 2010-06-10 15:04:31 |
Description
John Regehr
2010-06-09 21:02:03 UTC
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. |