summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-07 18:45:56 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-07 18:45:56 +0000
commitfaf2a98b94a4bef423a73f6a57eb9aafdd017a19 (patch)
treef586d335f31ec62e37bfd7708d7eb8de993cf531
parente50042428eac40d5b71fbd5a3fb43450e27e337d (diff)
downloadppe42-gcc-faf2a98b94a4bef423a73f6a57eb9aafdd017a19.tar.gz
ppe42-gcc-faf2a98b94a4bef423a73f6a57eb9aafdd017a19.zip
gcc/
2008-10-07 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/37731 * expmed.c (expand_mult): Properly check DImode constant in CONST_DOUBLE. gcc/testsuite/ 2008-10-07 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/37731 * gcc.dg/torture/pr37731-1.c: New. * gcc.dg/torture/pr37731-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140947 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/expmed.c3
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr37731-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr37731-2.c17
5 files changed, 48 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5582866162a..18911a224f4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/37731
+ * expmed.c (expand_mult): Properly check DImode constant in
+ CONST_DOUBLE.
+
2008-10-07 Jakub Jelinek <jakub@redhat.com>
PR debug/37738
diff --git a/gcc/expmed.c b/gcc/expmed.c
index ae5ad0a2f12..5e8d7f30324 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -3075,7 +3075,8 @@ expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target,
{
/* If we are multiplying in DImode, it may still be a win
to try to work with shifts and adds. */
- if (CONST_DOUBLE_HIGH (op1) == 0)
+ if (CONST_DOUBLE_HIGH (op1) == 0
+ && CONST_DOUBLE_LOW (op1) > 0)
coeff = CONST_DOUBLE_LOW (op1);
else if (CONST_DOUBLE_LOW (op1) == 0
&& EXACT_POWER_OF_2_OR_ZERO_P (CONST_DOUBLE_HIGH (op1)))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d3fdf004267..b33a77a0658 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/37731
+ * gcc.dg/torture/pr37731-1.c: New.
+ * gcc.dg/torture/pr37731-2.c: Likewise.
+
2008-10-07 Jakub Jelinek <jakub@redhat.com>
PR debug/37738
diff --git a/gcc/testsuite/gcc.dg/torture/pr37731-1.c b/gcc/testsuite/gcc.dg/torture/pr37731-1.c
new file mode 100644
index 00000000000..5c156b1f9a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr37731-1.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+
+extern void abort ();
+
+unsigned long long xh = 1;
+
+int
+main ()
+{
+ unsigned long long yh = 0xffffffffull;
+ unsigned long long z = xh * yh;
+
+ if (z != yh)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr37731-2.c b/gcc/testsuite/gcc.dg/torture/pr37731-2.c
new file mode 100644
index 00000000000..a7f8f1e02e5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr37731-2.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+
+extern void abort ();
+
+long long xh = 1;
+
+int
+main ()
+{
+ long long yh = 0xffffffffll;
+ long long z = xh * yh;
+
+ if (z != yh)
+ abort ();
+
+ return 0;
+}
OpenPOWER on IntegriCloud