This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: extendqihi2 and GCC RTL type system

On 02/22/2016 08:55 AM, David Edelsohn wrote:
csmith has uncovered a latent bug in the the PowerPC port for a
combiner pattern involving extendqihi2 (the alternative in the pattern
has never triggered for real code in over 10 years). Basic extendqihi2
works correctly (the instructions extend to entire register, but the
upper bits are ignored).

The PowerPC architecture can load and store HImode values, but cannot
compute directly on that mode -- only on SImode or DImode.
Right.  Similar to the PA in that regard.

One proposed fix for the bug would remove extendqihi2, forcing GCC to
use SUBREGs for HImode extend operations, as it does for all other
And that should work.

If I remove extendqihi2 (extend:HI pattern) from the PowerPC port,
will that cause any problems for the GCC RTL type system or inhibit
optimizations?   I see that Alpha and SPARC define extendqihi2, but
IA-64 and AArch64 do not, so there is precedent for both approaches.

Any insights would be appreciated.
It shouldn't cause any type system kinds of problems. It might cause missed optimizations though. I'm not sure if combine will handle optimizing away the SUBREG by exploiting LOAD_EXTEND_OP.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]