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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Target|                            |x86_64-*-*, i?86-*-*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-08-09
          Component|tree-optimization           |target
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think the issue is that &&L1 - &&L2 is not treated as a constant expression
and thus is expanded as

(insn 8 6 9 2 (set (reg:DI 86)
        (label_ref:DI [4 deleted])) "t.i":5:13 -1
     (insn_list:REG_LABEL_OPERAND 4 (nil)))
(insn 9 8 10 2 (parallel [
            (set (reg:DI 85)
                (minus:DI (reg:DI 86)
                    (label_ref:DI [6 deleted])))
            (clobber (reg:CC 17 flags))
        ]) "t.i":5:13 -1
     (insn_list:REG_LABEL_OPERAND 6 (nil)))

that might be ultimatively a target issue (the actual difference is to be
resolved by the assembler of course).  Simple testcase:

int foo()
{
L1:
L2:
return &&L1 - &&L2;
}

Reply via email to