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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-01-25
                 CC|                            |gjl at gcc dot gnu.org
      Known to work|                            |4.9.2
     Ever confirmed|0                           |1
      Known to fail|                            |5.2.1

--- Comment #4 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Senthil, isn't this supposed to be fixed in 5.3?

Compiling the PR67839 code from the test suite with -Os -c -mmcu=attiny44
generates the following assembler code:

main:
        sbi 0x1f,0
        cbi 0x1f,0
        sbi 0x20,0
        cbi 0x20,0
        in r24,__SREG__
        out __SREG__,r24
        ldi r30,lo8(96)
        ldi r31,0
        ld r24,Z
        st Z,r24
        ldi r24,0
        ldi r25,0
        ret
        .size   main, .-main
        .ident  "GCC: (GNU) 5.3.1 20160106"

BTW, why isn't 4.9 and older affected?

The *cbi and *sbi insn are usualy forged by combine.  Where 4.9 rejects

Failed to match this instruction:
(set (mem/v:QI (const_int 64 [0x40]) [0 MEM[(volatile char *)64B]+0 S1 A8])
    (ior:QI (mem/v:QI (const_int 64 [0x40]) [0 MEM[(volatile char *)64B]+0 S1
A8])
        (const_int 1 [0x1])))

5.3 accepts the exact same insn:

Successfully matched this instruction:
(set (mem/v:QI (const_int 64 [0x40]) [0 MEM[(volatile char *)64B]+0 S1 A8])
    (ior:QI (mem/v:QI (const_int 64 [0x40]) [0 MEM[(volatile char *)64B]+0 S1
A8])
        (const_int 1 [0x1])))

Only difference is that the constraint has been changed from "n" to "i" which
looks very odd to me.

Reply via email to