aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-01-13 17:37:52 +0100
committerJakub Jelinek <jakub@redhat.com>2023-01-13 17:37:52 +0100
commit254cf9552ffb1693f0bc74f6d25601dafafbc144 (patch)
tree5ce62545e85dc3fc3a8606a9ab1aff8249b851c1 /gcc
parent2356557148193f729b12a6e63b086fd5068e9623 (diff)
downloadgcc-254cf9552ffb1693f0bc74f6d25601dafafbc144.zip
gcc-254cf9552ffb1693f0bc74f6d25601dafafbc144.tar.gz
gcc-254cf9552ffb1693f0bc74f6d25601dafafbc144.tar.bz2
testsuite: Add another testcase from PR107131
This one is hand reduced to problematic code from optimized dump that used to be miscompiled during combine starting with r12-303 and fixed with r13-3530 aka PR107172 fix. 2023-01-13 Jakub Jelinek <jakub@redhat.com> PR target/107131 * gcc.c-torture/execute/pr107131.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr107131.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr107131.c b/gcc/testsuite/gcc.c-torture/execute/pr107131.c
new file mode 100644
index 0000000..d4259f1
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr107131.c
@@ -0,0 +1,18 @@
+/* PR target/107131 */
+
+__attribute__((noipa)) unsigned long long
+foo (unsigned char o)
+{
+ unsigned long long t1 = -(long long) (o == 0);
+ unsigned long long t2 = -(long long) (t1 > 10439075533421201520ULL);
+ unsigned long long t3 = -(long long) (t1 <= t2);
+ return t3;
+}
+
+int
+main ()
+{
+ if (foo (0) != -1ULL)
+ __builtin_abort ();
+ return 0;
+}