[Bug tree-optimization/46864] [4.5/4.6 Regression] ICE: verify_stmts failed: statement marked for throw, but doesn't with -fnon-call-exceptions

2010-12-10 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46864

--- Comment #4 from Jakub Jelinek jakub at gcc dot gnu.org 2010-12-10 
12:42:20 UTC ---
Author: jakub
Date: Fri Dec 10 12:42:12 2010
New Revision: 167685

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=167685
Log:
PR tree-optimization/46864
* tree-ssa-loop-im.c (loop_suitable_for_sm): Return false even
when there are EDGE_EH exit edges.

* g++.dg/opt/pr46864.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/opt/pr46864.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-loop-im.c


[Bug tree-optimization/46864] [4.5/4.6 Regression] ICE: verify_stmts failed: statement marked for throw, but doesn't with -fnon-call-exceptions

2010-12-09 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46864

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek jakub at gcc dot gnu.org 2010-12-09 
14:18:57 UTC ---
This is execute_sm's fault, rewrite_mem_ref_loc doesn't call
maybe_clean_eh_stmt.  Adding that call fixes the ICE, but a)
gimple_purge_dead_eh_edges isn't called (and can't be called immediately), and
I don't see how the correct eh edges would be added for the load and store
stmts that are added by store motion.  So, I wonder if execute_sm just
shouldn't give up optimizing if the mem ref might throw.


[Bug tree-optimization/46864] [4.5/4.6 Regression] ICE: verify_stmts failed: statement marked for throw, but doesn't with -fnon-call-exceptions

2010-12-09 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46864

--- Comment #2 from Jakub Jelinek jakub at gcc dot gnu.org 2010-12-09 
14:35:36 UTC ---
Caused by http://gcc.gnu.org/viewcvs?root=gccview=revrev=146776
I think, before that EH edges were EDGE_ABNORMAL and thus
loop_suitable_for_sm disabled the optimization.

So, one solution would be to test for (EDGE_ABNORMAL | EDGE_EH) there.


[Bug tree-optimization/46864] [4.5/4.6 Regression] ICE: verify_stmts failed: statement marked for throw, but doesn't with -fnon-call-exceptions

2010-12-09 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46864

--- Comment #3 from Richard Guenther rguenth at gcc dot gnu.org 2010-12-09 
14:51:59 UTC ---
Yep, that sounds sensible to me.


[Bug tree-optimization/46864] [4.5/4.6 Regression] ICE: verify_stmts failed: statement marked for throw, but doesn't with -fnon-call-exceptions

2010-12-09 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46864

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2010.12.09 20:15:43
 AssignedTo|unassigned at gcc dot   |jakub at gcc dot gnu.org
   |gnu.org |
   Target Milestone|--- |4.5.3
 Ever Confirmed|0   |1