2018-02-06 Michael Collison <michael.collison@arm.com>
authorMichael Collison <michael.collison@arm.com>
Tue, 6 Feb 2018 20:27:08 +0000 (20:27 +0000)
committerMichael Collison <collison@gcc.gnu.org>
Tue, 6 Feb 2018 20:27:08 +0000 (20:27 +0000)
* config/arm/thumb2.md:
(*thumb2_mov_negscc): Split only if TARGET_THUMB2 && !arm_restrict_it.
(*thumb_mov_notscc): Ditto.
* gcc.target/arm/pr7676.c: New testcase.

From-SVN: r257430

gcc/ChangeLog
gcc/config/arm/thumb2.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr7676.c [new file with mode: 0644]

index 2f203b6b7b755107d0ecee4ab7138008704d9986..c40d7e669cbdf5c89a83b9470e36c382d976bd8c 100644 (file)
@@ -1,3 +1,9 @@
+2018-02-06  Michael Collison  <michael.collison@arm.com>
+
+       * config/arm/thumb2.md:
+       (*thumb2_mov_negscc): Split only if TARGET_THUMB2 && !arm_restrict_it.
+       (*thumb_mov_notscc): Ditto.
+
 2018-02-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        PR target/84154
index 8eb20003ab2f6df847d9344ea78e0175ce6dd902..c42670f8643c3286bc5abf537d4fd0483cba68ac 100644 (file)
                 [(match_operand 2 "cc_register" "") (const_int 0)])))]
   "TARGET_THUMB2 && !arm_restrict_it"
   "#"   ; "ite\\t%D1\;mov%D1\\t%0, #0\;mvn%d1\\t%0, #0"
-  "TARGET_THUMB2"
+  "&& true"
   [(set (match_dup 0)
         (if_then_else:SI (match_dup 1)
                          (match_dup 3)
                 [(match_operand 2 "cc_register" "") (const_int 0)])))]
   "TARGET_THUMB2 && !arm_restrict_it"
   "#"   ; "ite\\t%D1\;mvn%D1\\t%0, #0\;mvn%d1\\t%0, #1"
-  "TARGET_THUMB2"
+  "&& true"
   [(set (match_dup 0)
         (if_then_else:SI (match_dup 1)
                          (match_dup 3)
index be9f3153c0daccf060241cf187e4ce531937f1da..14bcd62496247414f0384ca964d37faf98ff88ec 100644 (file)
@@ -1,3 +1,7 @@
+2018-02-06  Michael Collison  <michael.collison@arm.com>
+
+       * gcc.target/arm/pr7676.c: New testcase for incorrect splitting.
+
 2018-02-06  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        * gcc.target/powerpc/safe-indirect-jump-1.c: Detect deprecation
diff --git a/gcc/testsuite/gcc.target/arm/pr7676.c b/gcc/testsuite/gcc.target/arm/pr7676.c
new file mode 100644 (file)
index 0000000..349d7a3
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -march=armv8-a -mfloat-abi=soft -mthumb" }  */
+/* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=hard" -mfloat-abi=softfp } {""} } */
+int a;
+
+void fn2 (long long);
+
+void
+fn1 ()
+{
+  long long b;
+
+  for (;;)
+    {
+      b = ((a == (int)&fn1) <= 0 ^ 18446744073709551608ULL)
+       - 18446744073709551615ULL;
+
+      fn2 (b);
+    }
+}