[Bug tree-optimization/56486] [4.6/4.7 Regression] infinite loop in cc1 at -O1 and above

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 1 10:11:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56486

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-03-01
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |4.6.4
            Summary|infinite loop in cc1 at -O1 |[4.6/4.7 Regression]
                   |and above                   |infinite loop in cc1 at -O1
                   |                            |and above
     Ever Confirmed|0                           |1

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-01 10:10:09 UTC ---
Fixed on trunk by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187053
which made gsi_for_stmt O(1).
Random interruption in gdb shows that most time is spent in
#0  0x00000000008bddd5 in gsi_next (i=0x7fffffffdb90) at
../../gcc/gimple.h:4945
#1  0x00000000008bf07a in gsi_for_stmt (stmt=0x7ffff1393b00) at
../../gcc/gimple-iterator.c:560
#2  0x0000000000cfe4dc in remove_visited_stmt_chain (var=0x7ffff1394e10) at
../../gcc/tree-ssa-reassoc.c:2228
#3  0x0000000000cfeb5b in rewrite_expr_tree (stmt=0x7ffff1393c60, opindex=0,
ops=0x3505a80, moved=0 '\000') at ../../gcc/tree-ssa-reassoc.c:2383
#4  0x0000000000d02614 in reassociate_bb (bb=0x7ffff1580750) at
../../gcc/tree-ssa-reassoc.c:3607
#5  0x0000000000d02691 in reassociate_bb (bb=0x7ffff15806e8) at
../../gcc/tree-ssa-reassoc.c:3617
#6  0x0000000000d0277f in do_reassoc () at ../../gcc/tree-ssa-reassoc.c:3650
#7  0x0000000000d02b57 in execute_reassoc () at
../../gcc/tree-ssa-reassoc.c:3742

or similar.  Guess for 4.7 and 4.6 perhaps remove_visited_stmt_chain should
before trying gsi_for_stmt test whether gsi from previous iteration isn't
in the same bb as the stmt we'd call gsi_for_stmt on, and if yes, walk from
that gsi backwards manually instead of calling gsi_for_stmt (because, the
definitions generally should be before the uses).  That would make
remove_visited_stmt_chain linear complexity instead of quadratic.



More information about the Gcc-bugs mailing list