Could not identify that register is clobbered already

"S, Pitchumani" <[email protected]>
Newsgroups gmane.comp.gcc.devel,gmane.comp.hardware.avr.gcc
Message-ID <CAC140656783604CABA6AE60C2A6D5A43273710A@penmbx02>
Hi,

I was analyzing an issue for avr target (gcc-4.7.2).

Issue is that already clobbered register is used after the transformation
in post reload pass.

insns after reload pass:

set (reg:HI r24
    (const:HI (plus:HI (symbol_ref:HI ("array"))
                       (const_int 4))
    ))
...
parallel set (reg:HI r14
             (and:HI (reg:HI r14)
                     (const_int 3)))
         clobber:QI r25
...
set (reg:HI r28
    (const:HI (plus:HI (symbol_ref:HI ("array"))
                       (const_int 4))
    ))

After post reload pass, insn-3 transformed as follows:

set (reg:HI r28
     reg:HI r24)

this transformation happened in reload_cse_move2add function.

Since r25 is clobbered in insn-2, above transformation (r28/29 <= r24/25) 
become incorrect.

Function 'move2add_use_add3_insn' sets only r24 info for insn-1 instead
of setting info for both r24/25. Function 'validate_change' checks only r24
info for insn-3 transformation.
is it possible to identify clobbered register and avoid transformation?

Regards,
Pitchumani
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.