]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/91632 (Probably wrong code since r275026)
authorJakub Jelinek <jakub@redhat.com>
Mon, 21 Oct 2019 11:39:04 +0000 (13:39 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 21 Oct 2019 11:39:04 +0000 (13:39 +0200)
Backported from mainline
2019-09-02  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/91632
* gcc.c-torture/execute/pr91632.c: New test.

From-SVN: r277247

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

index 28a8cb5b136d4bb69b2d42ee0925f8948f366e2a..e2a268fafafb2460ab2e60f34e90efb1a4e7261a 100644 (file)
@@ -1,6 +1,11 @@
 2019-10-21  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2019-09-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/91632
+       * gcc.c-torture/execute/pr91632.c: New test.
+
        2019-09-01  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/91623
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;
+}