On Tue, Jun 9, 2015 at 9:30 PM, Jakub Jelinek <ja...@redhat.com> wrote: > On Tue, Jun 09, 2015 at 08:09:28PM +0200, Uros Bizjak wrote: >> Please find attach a patch that takes your idea slightly further. We >> find perhaps zero-extended UNSPEC_TP, and copy it for further use. At >> its place, we simply slap const0_rtx. We know that address to > > Is that safe? I mean, the address, even if offsetable, can have some > immediate already (seems e.g. the offsettable_memref_p predicate just checks > you can plus_constant some small integer and be recognized again) and if you > turn the %gs: into a const0_rtx, it would fail next decompose. > And when you already have the PLUS which has UNSPEC_TP as one of its > arguments, replacing that PLUS with the other argument is IMHO very easy. > Perhaps you are right that there is no need to copy_rtx, supposedly > the rtx shouldn't be shared with anything and thus can be modified in place.
Hm, you are right. I was under impression that decompose_address can handle multiple CONST_INT addends, which is unfortunatelly not the case. > If -mx32 is a non-issue here, then perhaps my initial patch is good enough? It looks to me, that if you detect and record zero-extended UNSPEC_TP, your original patch would also handle -mx32. Can you please repost your original patch with the above addition? Thanks, Uros.