https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97954

--- Comment #2 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #1)
> Started with r11-5002-ge3b3b59683c1e7d3.

Before the patch, gcc just reported an error.  Now it is a crash.

The problem is not the patch itself but in the loop invariant motion.

For some reason, loop invariant motion optimization moves asm goto insn out of
the loop as the invariant insn.  asm goto is a branch.  When we move branch as
a regular insn, we have what we have.  Here is loop2_invariant dump:

...
(jump_insn 8 6 11 4 (parallel [
            (set (reg:SI 83 [ x ])
                (asm_operands:SI ("") ("=a") 0 []
                     []
                     [
                        (label_ref:DI 21)
                    ] z1.c:6))
            (clobber (reg:CC 17 flags))
        ]) "z1.c":6:3 -1
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil))
 -> 21)

...

*****ending processing of loop 1 ******
Set in insn 8 is invariant (0), cost 4, depends on
Decided to move invariant 0 -- gain 4
Invariant 0 moved without introducing a new temporary register
changing bb of uid 8
  from 4 to 2
starting the processing of deferred insns
ending the processing of deferred insns


I think a maintainer of loop optimizations should look at this.

Reply via email to