Hi! On Fri, Aug 27, 2021 at 05:20:22PM -0600, Jeff Law via Gcc-patches wrote: > On 8/27/2021 3:57 PM, Roger Sayle wrote: > >As recently remarked by Jeff Law, SUBREGs are the "forever chemicals" > >of GCC's RTL; once created they persist in the environment. The problem, > >according to the comment on lines 5428-5438 of combine.c is that > >non-tieable SUBREGs interfere with reload/register allocation, so > >combine often doesn't touch/clean-up instructions containing a SUBREG. > Forever chemicals. I like that term.
It is a very clever name in its original meaning. Not only are PFAS and the like not degraded in the environment, but that is because the F-C bond is so strong... the "Forever-Chemical" bond. Chemists make even worse puns than compiler developers :-) SUBREGs are like perfluoralkyls in more ways: they have huge problems, but there is no real replacement for them either. > >Alas currently, during combine the middle TRUNCATE is converted into > >a lowpart SUBREG, which subst then turns into (clobber (const_int 0)), > >abandoning the attempted combination, that then never reaches recog. Yeah, combine notices it can optimise away the TRUNCATE (a SUBREG is free, is just a reinterpret_cast thingy, no machine operation). With this code disabled (for !TRULY_NOOP_TRUNCATION_MODES_P) you will get less optimised code. > >But it only affects !TRULY_NOOP_TRUNCATION targets, and the motivating > >example above is derived from the behaviour of backend patches not yet > >in the tree [nvptx is currently a STORE_FLAG_VALUE=-1 target]. Should the TARGET_TRULY_NOOP_TRUNCATION documentation be updated now? In particular the part that talks about TARGET_MODES_TIEABLE_P. Segher