This is the mail archive of the
mailing list for the GCC project.
extendqihi2 and GCC RTL type system
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: GCC Development <gcc at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>, Jeffrey Law <law at redhat dot com>, Jim Wilson <jim dot wilson at linaro dot org>
- Date: Mon, 22 Feb 2016 10:55:19 -0500
- Subject: extendqihi2 and GCC RTL type system
- Authentication-results: sourceware.org; auth=none
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.
One proposed fix for the bug would remove extendqihi2, forcing GCC to
use SUBREGs for HImode extend operations, as it does for all other
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.