]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/38789 (__builtin_constant_p appears to evaluate...
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 30 Jan 2009 17:46:24 +0000 (17:46 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 30 Jan 2009 17:46:24 +0000 (09:46 -0800)
2009-01-30  H.J. Lu  <hongjiu.lu@intel.com>

Backport from mainline:
2009-01-16  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/38789
* gcc.c-torture/compile/pr38789.c: New test.

From-SVN: r143799

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr38789.c [new file with mode: 0644]

index e2c0572524b5f8d4fad5df64ca62fde887aa13b2..ee63e611938f1dcb123c4c5a257baa5fa71e6636 100644 (file)
@@ -1,5 +1,14 @@
 2009-01-30  H.J. Lu  <hongjiu.lu@intel.com>
 
+       Backport from mainline:
+       2009-01-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/38789
+       * gcc.c-torture/compile/pr38789.c: New test.
+
+2009-01-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backport from mainline:
        2009-01-27  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/38503
@@ -25,6 +34,7 @@
 
 2009-01-29  H.J. Lu  <hongjiu.lu@intel.com>
 
+       Backport from mainline:
        2009-01-28  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/38908
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr38789.c b/gcc/testsuite/gcc.c-torture/compile/pr38789.c
new file mode 100644 (file)
index 0000000..9179f6c
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR tree-optimization/38789 */
+
+void
+baz (int v)
+{
+  unsigned a = (v == 1) ? 1 : 2;
+
+  if (__builtin_constant_p (a))
+    asm volatile ("# constant %0" :: "i" (a));
+  else
+    asm volatile ("# register %0" :: "r" (a));
+
+  a = 6;
+  if (__builtin_constant_p (a))
+    asm volatile ("# constant %0" :: "i" (a));
+  else
+    asm volatile ("# register %0" :: "r" (a));
+}