]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/64882 (ICE on valid code at -O3 with -g enabled in simplify_su...
authorUros Bizjak <ubizjak@gmail.com>
Wed, 4 Feb 2015 21:46:01 +0000 (22:46 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 4 Feb 2015 21:46:01 +0000 (22:46 +0100)
Backport from mainline
2015-01-31  Uros Bizjak  <ubizjak@gmail.com>

        PR target/64882
* config/i386/predicates.md (address_no_seg_operand): Reject
non-CONST_INT_P operands in invalid mode.

Backport from mainline
2015-01-31  Uros Bizjak  <ubizjak@gmail.com>

* config/i386/predicates.md (lea_address_operand): Call
address_operand with VOIDmode.
(vsib_address_operand): Ditto.

testsuite/ChangeLog:

Backport from mainline
2015-01-31  Uros Bizjak  <ubizjak@gmail.com>

        PR target/64882
* gcc.dg/torture/pr64882.c: New test.

From-SVN: r220418

gcc/ChangeLog
gcc/config/i386/predicates.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr64882.c [new file with mode: 0644]

index 246c8d7d90675510f708c2a3f385c619f31fff54..fabe60089449626c406576b7280bc1adcfb38085 100644 (file)
@@ -1,3 +1,19 @@
+2015-02-04  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2015-01-31  Uros Bizjak  <ubizjak@gmail.com>
+
+        PR target/64882
+       * config/i386/predicates.md (address_no_seg_operand): Reject
+       non-CONST_INT_P operands in invalid mode.
+
+       Backport from mainline
+       2015-01-31  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/predicates.md (lea_address_operand): Call
+       address_operand with VOIDmode.
+       (vsib_address_operand): Ditto.
+
 2015-02-01  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
index 0e52c85184ed1610f0498c290ceac39aebc94d72..61614e112467cbf1f3fc125ebe9735f63d7dfe97 100644 (file)
 ;; a segment override.  Defined as a special predicate to allow
 ;; mode-less const_int operands pass to address_operand.
 (define_special_predicate "lea_address_operand"
-  (match_operand 0 "address_operand")
+  (match_test "address_operand (op, VOIDmode)")
 {
   struct ix86_address parts;
   int ok;
 
+  if (!CONST_INT_P (op)
+      && mode != VOIDmode
+      && GET_MODE (op) != mode)
+    return false;
+
   ok = ix86_decompose_address (op, &parts);
   gcc_assert (ok);
   return parts.seg == SEG_DEFAULT;
 ;; Return true if op if a valid base register, displacement or
 ;; sum of base register and displacement for VSIB addressing.
 (define_predicate "vsib_address_operand"
-  (match_operand 0 "address_operand")
+  (match_test "address_operand (op, VOIDmode)")
 {
   struct ix86_address parts;
   int ok;
index f0d9e5e328dc05c7a5fc6b821e37d53804a9915f..a3d4b249ddd6b52f2c556de57ed35594c3bb9ddf 100644 (file)
@@ -1,3 +1,11 @@
+2015-02-04  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2015-01-31  Uros Bizjak  <ubizjak@gmail.com>
+
+        PR target/64882
+       * gcc.dg/torture/pr64882.c: New test.
+
 2015-02-01  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
diff --git a/gcc/testsuite/gcc.dg/torture/pr64882.c b/gcc/testsuite/gcc.dg/torture/pr64882.c
new file mode 100644 (file)
index 0000000..462edac
--- /dev/null
@@ -0,0 +1,33 @@
+/* PR target/64882 */
+/* { dg-do compile } */
+
+int a, d, e;
+long long b;
+static long long *c = &b;
+
+void
+fn1 (short p)
+{
+}
+
+long long
+fn2 (long long p1, long long p2)
+{
+  return (p1 && p1 > 26854775807LL - p2) || p1 < -p2 ? p1 : p1 + p2;
+}
+
+void
+fn3 ()
+{
+  long long f;
+  int g = 3;
+  int *h = &a;
+  for (e = 0; e < 2; e++)
+    {
+      int *i = &g;
+      if (!fn2 (*c, 7 < d % (*i)--))
+       f = fn2 ((*h <= 0) | b, 5278350700LL);
+      *h = f;
+      fn1 (*h);
+    }
+}