]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/65990 (ICE: in extract_insn, at recog.c:2341 (unrecognizable insn) with...
authorUros Bizjak <ubizjak@gmail.com>
Wed, 6 May 2015 16:21:07 +0000 (18:21 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 6 May 2015 16:21:07 +0000 (18:21 +0200)
PR target/65990
* config/i386/i386.c (ix86_parse_stringop_strategy_string): Error out
if rep_8byte stringop strategy was specified for 32-bit target.

testsuite/ChangeLog:

PR target/65990
* gcc.target/i386/pr65990.c: New test.

From-SVN: r222859

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr65990.c [new file with mode: 0644]

index 446b3f922975f29dcf0e3dc217c7842ff61873ef..54d637bf63d1c35a6087da345ca1679b1c3719fc 100644 (file)
@@ -1,3 +1,9 @@
+2015-05-06  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/65990
+       * config/i386/i386.c (ix86_parse_stringop_strategy_string): Error out
+       if rep_8byte stringop strategy was specified for 32-bit target.
+
 2015-05-05  Jack Howarth  <howarth.at.gcc@gmail.com>
 
        Backport from mainline
index 8d33655c2276fdb5be9d683cca4a133e98e66a60..394832966cd030d09fd5d270b57b102d457d2bbe 100644 (file)
@@ -2934,6 +2934,17 @@ ix86_parse_stringop_strategy_string (char *strategy_str, bool is_memset)
           return;
         }
 
+      if ((stringop_alg) i == rep_prefix_8_byte
+         && !TARGET_64BIT)
+       {
+         /* rep; movq isn't available in 32-bit code.  */
+         error ("stringop strategy name %s specified for option %s "
+                "not supported for 32-bit code",
+                 alg_name,
+                 is_memset ? "-mmemset_strategy=" : "-mmemcpy_strategy=");
+         return;
+       }
+
       input_ranges[n].max = maxs;
       input_ranges[n].alg = (stringop_alg) i;
       if (!strcmp (align, "align"))
index a8f3c3e9c43795b9b1ef6316be41d85350427c7e..b2a75c1b0d92a835d1b4b9b0f717f7b05403f09c 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-06  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/65990
+       * gcc.target/i386/pr65990.c: New test.
+
 2015-05-06  Uros Bizjak  <ubizjak@gmail.com>
 
        * g++.dg/cpp1y/auto-fn26.C (dg-do): Use c++1y target.
diff --git a/gcc/testsuite/gcc.target/i386/pr65990.c b/gcc/testsuite/gcc.target/i386/pr65990.c
new file mode 100644 (file)
index 0000000..c0e5bb6
--- /dev/null
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-mtune=btver2 -mmemcpy-strategy=rep_8byte:-1:noalign" }
+
+/* { dg-error "stringop strategy name rep_8byte specified for option -mmemcpy_strategy= not supported for 32-bit code" "" { target ia32 } 0 } */
+
+struct U9
+{
+  unsigned a[9];
+};
+
+struct U9 u9;
+
+void
+foo ()
+{
+  u9 = (struct U9) {
+    .a = {
+      0xFF,
+      0xFF,
+      0xFF,
+      0xFF,
+      0xFF,
+      0xFF,
+      0xFF,
+      0xFF,
+      0xFF
+    }
+  };
+}