[PATCH] middle-end/94614 - avoid multiword moves to nothing

Jeff Law law@redhat.com
Thu Apr 16 22:56:41 GMT 2020


On Thu, 2020-04-16 at 10:05 +0200, Richard Biener wrote:
> This adjusts emit_move_multi_word to handle moves into paradoxical
> subregs parts that are not there and resolve_clobber to handle
> such subregs.
> 
> Bootstrap & regtest running on x86_64-unknown-linux-gnu.
> 
> The testcase involves writing to a register out of bounds so I'm not
> sure this is the correct place to paper over this or whether RTL
> expansion should have done things differently.
> 
> ;; MEM[(v4si *)&res] = v_2(D);
> 
> (insn 12 9 10 (clobber (subreg:TI (reg/v:DI 113 [ res ]) 0)) 
> "pr94574.c":13:18 -1
>      (nil))
> 
> (insn 10 12 11 (set (subreg:SI (reg/v:DI 113 [ res ]) 0)
>         (subreg:SI (reg/v:TI 115 [ v ]) 0)) "pr94574.c":13:18 -1
>      (nil))
> 
> (insn 11 10 0 (set (subreg:SI (reg/v:DI 113 [ res ]) 4)
>         (subreg:SI (reg/v:TI 115 [ v ]) 4)) "pr94574.c":13:18 -1
>      (nil))
> 
> maybe we should simply force regs with out-of-bound accesses to
> memory?  The above is the RTL generated after the first half of the
> fix.  We still generate
> 
> (insn 12 7 10 2 (clobber (subreg:TI (reg/v:DI 113 [ res ]) 0)) 
> "pr94574.c":13:18 -1  
>      (nil))
> 
> which lower-subreg runs into - I did not track down where that
> is generated, but I understand the subreg is pointless here?
Yea.  The whole point of these clobbers is to indicate to the various analysis
passes that the whole object is clobbered.  In the case of a paradoxical pseudo
we could just strip the subreg.

If we knew there was a set of the SUBREG_REG object, then we could emit the
clobber completely since it carries no useful information at that point.

Jeff





More information about the Gcc-patches mailing list