]> gcc.gnu.org Git - gcc.git/commitdiff
re PR rtl-optimization/8423 (CSE1 not propagating __builtin_constant_p enough)
authorDiego Novillo <dnovillo@redhat.com>
Sat, 2 Nov 2002 22:58:54 +0000 (22:58 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Sat, 2 Nov 2002 22:58:54 +0000 (17:58 -0500)
PR optimization/8423
* gcc.c-torture/execute/builtin-constant.c: New test.

From-SVN: r58760

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/builtin-constant.c [new file with mode: 0644]

index 2b88c1f85d3fb7daf4df56607422ccfcd7118f02..be1e6026bdecc7d2189c3db75e340e05db7ba474 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-02  Diego Novillo  <dnovillo@redhat.com>
+
+       PR optimization/8423
+       * gcc.c-torture/execute/builtin-constant.c: New test.
+
 2002-11-01  Zack Weinberg  <zack@codesourcery.com>
 
        * g++.dg/ext/typedef-init.C, gcc.dg/typedef-init.C:
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtin-constant.c b/gcc/testsuite/gcc.c-torture/execute/builtin-constant.c
new file mode 100644 (file)
index 0000000..9e5bfb8
--- /dev/null
@@ -0,0 +1,26 @@
+/* PR optimization/8423.  */
+
+#define btest(x) __builtin_constant_p(x) ? "1" : "0"
+
+#ifdef __OPTIMIZE__
+void
+foo (char *i)
+{
+  if (*i == '0')
+    abort ();
+}
+#else
+void
+foo (char *i)
+{
+}
+#endif
+
+int
+main (void)
+{
+  int size = sizeof (int);
+  foo (btest (size));
+  foo (btest (size));
+  exit (0);
+}
This page took 0.088245 seconds and 5 git commands to generate.