aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2009-05-18 15:36:18 +0000
committerAndreas Schwab <schwab@gcc.gnu.org>2009-05-18 15:36:18 +0000
commitc4406f742979f1007a2514c02f1e8af1001b0676 (patch)
tree8859c283712b3c086b2e972e122e2d4afe618d47
parente35bbb23ad67dac0f5d0a5b7dd1b27470c1acc78 (diff)
downloadgcc-c4406f742979f1007a2514c02f1e8af1001b0676.zip
gcc-c4406f742979f1007a2514c02f1e8af1001b0676.tar.gz
gcc-c4406f742979f1007a2514c02f1e8af1001b0676.tar.bz2
re PR target/39531 (m68k gcc does not convert andil to bclr when compiled on a 64bit host)
PR target/39531 * config/m68k/m68k.c (output_andsi3): Mask off sign bit copies before calling exact_log2. (output_iorsi3): Likewise. (output_xorsi3): Likewise. From-SVN: r147664
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/m68k/m68k.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 575773f..7b2a7bf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2009-05-18 Andreas Schwab <schwab@linux-m68k.org>
+
+ PR target/39531
+ * config/m68k/m68k.c (output_andsi3): Mask off sign bit copies
+ before calling exact_log2.
+ (output_iorsi3): Likewise.
+ (output_xorsi3): Likewise.
+
2009-05-18 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (expand_cbranchdi4): Use a scratch register
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index de20fdb..ec371e5 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -4829,7 +4829,7 @@ output_andsi3 (rtx *operands)
return "and%.w %2,%0";
}
if (GET_CODE (operands[2]) == CONST_INT
- && (logval = exact_log2 (~ INTVAL (operands[2]))) >= 0
+ && (logval = exact_log2 (~ INTVAL (operands[2]) & 0xffffffff)) >= 0
&& (DATA_REG_P (operands[0])
|| offsettable_memref_p (operands[0])))
{
@@ -4866,7 +4866,7 @@ output_iorsi3 (rtx *operands)
return "or%.w %2,%0";
}
if (GET_CODE (operands[2]) == CONST_INT
- && (logval = exact_log2 (INTVAL (operands[2]))) >= 0
+ && (logval = exact_log2 (INTVAL (operands[2]) & 0xffffffff)) >= 0
&& (DATA_REG_P (operands[0])
|| offsettable_memref_p (operands[0])))
{
@@ -4901,7 +4901,7 @@ output_xorsi3 (rtx *operands)
return "eor%.w %2,%0";
}
if (GET_CODE (operands[2]) == CONST_INT
- && (logval = exact_log2 (INTVAL (operands[2]))) >= 0
+ && (logval = exact_log2 (INTVAL (operands[2]) & 0xffffffff)) >= 0
&& (DATA_REG_P (operands[0])
|| offsettable_memref_p (operands[0])))
{