re PR target/64882 (ICE on valid code at -O3 with -g enabled in simplify_subreg,...
authorUros Bizjak <ubizjak@gmail.com>
Sat, 31 Jan 2015 15:30:30 +0000 (16:30 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Sat, 31 Jan 2015 15:30:30 +0000 (16:30 +0100)
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.

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

* config/i386/i386.md (*prefetch_prefetchw1): Remove mode of
address_operand 0.  Rename from *prefetch_prefetchwt1_<mode>.
* config/i386/predicates.md (address_no_seg_operand): Call
address_operand with VOIDmode.
(vsib_address_operand): Ditto.
(address_mpx_no_base_operand): Ditto.
(address_mpx_no_index_operand): Ditto.

testsuite/ChangeLog:

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

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

From-SVN: r220306

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

index 0e1e8bb2d8ba1fe8124719b2d57ba22c74bae650..19cb15cf6b869f7bd44cc6b6b366704e5fc6dfb6 100644 (file)
@@ -1,3 +1,19 @@
+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.
+
+2015-01-31  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.md (*prefetch_prefetchw1): Remove mode of
+       address_operand 0.  Rename from *prefetch_prefetchwt1_<mode>.
+       * config/i386/predicates.md (address_no_seg_operand): Call
+       address_operand with VOIDmode.
+       (vsib_address_operand): Ditto.
+       (address_mpx_no_base_operand): Ditto.
+       (address_mpx_no_index_operand): Ditto.
+
 2015-01-30  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR target/64688
index 5cefa81da96e3cf9a1ca7f3e0316071587194949..2d3d07585c3dbe707a4b616cda12dd50d95d4bea 100644 (file)
        (symbol_ref "memory_address_length (operands[0], false)"))
    (set_attr "memory" "none")])
 
-(define_insn "*prefetch_prefetchwt1_<mode>"
-  [(prefetch (match_operand:P 0 "address_operand" "p")
+(define_insn "*prefetch_prefetchwt1"
+  [(prefetch (match_operand 0 "address_operand" "p")
             (const_int 1)
             (const_int 2))]
   "TARGET_PREFETCHWT1"
index 40dfa5198616d0f89969a79d5928e54a8b512ffe..0f314ccb0e3e76eaccbe1d416f5f0a6c3aea1c18 100644 (file)
 ;; a segment override.  Defined as a special predicate to allow
 ;; mode-less const_int operands pass to address_operand.
 (define_special_predicate "address_no_seg_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;
 
 ;; Return true if op is valid MPX address operand without base
 (define_predicate "address_mpx_no_base_operand"
-  (match_operand 0 "address_operand")
+  (match_test "address_operand (op, VOIDmode)")
 {
   struct ix86_address parts;
   int ok;
 
 ;; Return true if op is valid MPX address operand without index
 (define_predicate "address_mpx_no_index_operand"
-  (match_operand 0 "address_operand")
+  (match_test "address_operand (op, VOIDmode)")
 {
   struct ix86_address parts;
   int ok;
index 256934126f4424a1037b24024a9616306de2d2f4..54dc54380435592fd8b9fc04779f6181d0935457 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-31  Uros Bizjak  <ubizjak@gmail.com>
+
+        PR target/64882
+       * gcc.dg/torture/pr64882.c: New test.
+
 2015-01-31  David Edelsohn  <dje.gcc@gmail.com>
 
        PR target/64159
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);
+    }
+}