re PR tree-optimization/91632 (Probably wrong code since r275026)
authorJakub Jelinek <jakub@redhat.com>
Mon, 2 Sep 2019 13:35:54 +0000 (15:35 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 2 Sep 2019 13:35:54 +0000 (15:35 +0200)
PR tree-optimization/91632
* gcc.c-torture/execute/pr91632.c: New test.

From-SVN: r275318

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

index b6dbf7681678bd32b1bcaad133da728382e31952..3f46b84c0bc17ce24c662eea304711620572a2a6 100644 (file)
@@ -1,3 +1,8 @@
+2019-09-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/91632
+       * gcc.c-torture/execute/pr91632.c: New test.
+
 2019-09-02  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.dg/tree-ssa/slsr-42.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr91632.c b/gcc/testsuite/gcc.c-torture/execute/pr91632.c
new file mode 100644 (file)
index 0000000..c16c3da
--- /dev/null
@@ -0,0 +1,30 @@
+/* PR tree-optimization/91632 */
+/* { dg-additional-options "-fwrapv" } */
+
+static int
+__attribute__((noipa))
+foo (char x)
+{
+  switch (x)
+    {
+    case '"':
+    case '<':
+    case '>':
+    case '\\':
+    case '^':
+    case '`':
+    case '{':
+    case '|':
+    case '}':
+      return 0;
+    }
+  return 1;
+}
+
+int
+main ()
+{
+  if (foo ('h') == 0)
+    __builtin_abort ();
+  return 0;
+}