aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2024-01-15 17:35:04 +0100
committerJakub Jelinek <jakub@redhat.com>2024-01-15 17:35:04 +0100
commit2e493b697a4cb135b0af6944d0c1f3c8f59e8caf (patch)
tree829aa02e2d7d2cdf8a6350886a5f2ffd0ba506a9 /gcc
parent42503cc257fb841904917c9529f24c76511c4e0d (diff)
downloadgcc-2e493b697a4cb135b0af6944d0c1f3c8f59e8caf.zip
gcc-2e493b697a4cb135b0af6944d0c1f3c8f59e8caf.tar.gz
gcc-2e493b697a4cb135b0af6944d0c1f3c8f59e8caf.tar.bz2
testsuite: Add testcase for already fixed PR [PR113048]
The ICE on this testcase was fixed by r14-7141. 2024-01-15 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/113048 * gcc.target/i386/pr113048.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.target/i386/pr113048.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr113048.c b/gcc/testsuite/gcc.target/i386/pr113048.c
new file mode 100644
index 0000000..4f228a8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr113048.c
@@ -0,0 +1,26 @@
+/* PR rtl-optimization/113048 */
+/* { dg-do compile } */
+/* { dg-options "-O -march=cascadelake -fwrapv" } */
+
+signed char a, b, c;
+int d;
+const char *e, *q;
+short f;
+int g;
+
+void
+foo (int x, long long y, long long z)
+{
+ unsigned char h = x;
+ int i = __builtin_strncmp (q, e, 2);
+ h /= g;
+ unsigned long long j = (~z & (0xfb5856dd8a4d4702ULL & f) / 0) * h; /* { dg-warning "division by zero" } */
+ b += __builtin_add_overflow_p (d, c, 0);
+ signed char k = y;
+ long l = -k & sizeof (0);
+ long long m = y + j + z + h + 3 + l;
+ int n = m + i;
+ short o = n + f;
+ signed char p = o + h + k;
+ a = p;
+}