fix m68k target/7594
Richard Henderson
rth@twiddle.net
Thu Jun 12 22:06:00 GMT 2003
The bug is that STRICT_LOW_PART *must* be used with a SUBREG,
except that the backend is using gen_lowpart to create it,
which tries to simplify the result.
The following fixes the provided test case, and makes sense
to me. I'll leave the PR in feedback until someone can test
this for real on an m68k target.
r~
* config/m68k/m68k.md (zero_extendhisi2): Use gen_lowpart_SUBREG.
(zero_extendqihi2, zero_extendqisi2): Likewise.
Index: config/m68k/m68k.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.md,v
retrieving revision 1.58
diff -c -p -d -u -r1.58 m68k.md
--- config/m68k/m68k.md 23 May 2003 18:19:21 -0000 1.58
+++ config/m68k/m68k.md 12 Jun 2003 21:46:36 -0000
@@ -1332,7 +1332,7 @@
"
{
operands[1] = make_safe_from (operands[1], operands[0]);
- operands[2] = gen_lowpart (HImode, operands[0]);
+ operands[2] = gen_lowpart_SUBREG (HImode, operands[0]);
}")
(define_expand "zero_extendqihi2"
@@ -1344,7 +1344,7 @@
"
{
operands[1] = make_safe_from (operands[1], operands[0]);
- operands[2] = gen_lowpart (QImode, operands[0]);
+ operands[2] = gen_lowpart_SUBREG (QImode, operands[0]);
}")
(define_expand "zero_extendqisi2"
@@ -1356,7 +1356,7 @@
"
{
operands[1] = make_safe_from (operands[1], operands[0]);
- operands[2] = gen_lowpart (QImode, operands[0]);
+ operands[2] = gen_lowpart_SUBREG (QImode, operands[0]);
}")
;; Patterns to recognize zero-extend insns produced by the combiner.
More information about the Gcc-patches
mailing list