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 computations. 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. Thanks, David