OSDN Git Service

PR target/53187
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 May 2012 10:17:02 +0000 (10:17 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 May 2012 10:17:02 +0000 (10:17 +0000)
* config/arm/arm.c (arm_select_cc_mode): If x has MODE_CC class
mode, return that mode.

* gcc.target/arm/pr53187.c: New test.
* gcc.c-torture/compile/pr53187.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@187086 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr53187.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/pr53187.c [new file with mode: 0644]

index c096f79..84e48c2 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/53187
+       * config/arm/arm.c (arm_select_cc_mode): If x has MODE_CC class
+       mode, return that mode.
+
 2012-05-03  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/53144
index ba081d1..01dda9a 100644 (file)
@@ -11723,6 +11723,9 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y)
        }
     }
 
+  if (GET_MODE_CLASS (GET_MODE (x)) == MODE_CC)
+    return GET_MODE (x);
+
   return CCmode;
 }
 
index 634f093..e5adc51 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/53187
+       * gcc.target/arm/pr53187.c: New test.
+       * gcc.c-torture/compile/pr53187.c: New test.
+
 2012-05-03  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/53144
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr53187.c b/gcc/testsuite/gcc.c-torture/compile/pr53187.c
new file mode 100644 (file)
index 0000000..13455f4
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR target/53187 */
+
+void bar (int);
+
+void
+foo (int x, double y, double z)
+{
+  _Bool t = z >= y;
+  if (!t || x)
+    bar (t ? 1 : 16);
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr53187.c b/gcc/testsuite/gcc.target/arm/pr53187.c
new file mode 100644 (file)
index 0000000..648a06d
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR target/53187 */
+/* { dg-do compile } */
+/* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */
+
+void bar (int);
+
+void
+foo (int x, double y, double z)
+{
+  _Bool t = z >= y;
+  if (!t || x)
+    bar (t ? 1 : 16);
+}