From: Jakub Jelinek <jakub@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: [committed] testsuite: Add testcases from PR108292 and PR108308
Date: Fri, 6 Jan 2023 10:56:05 +0100 [thread overview]
Message-ID: <Y7fwNTmas50x4CUm@tucnak> (raw)
Hi!
These PRs were for now fixed by reversion of the r13-4977
patch, but so that the problems don't reappear during stage 1,
I'm adding testcase coverage from those PRs.
Tested on x86_64-linux -m32/-m64 before r13-5038 (where all tests
FAIL) and after it (where they PASS), committed to trunk as obvious.
2023-01-06 Jakub Jelinek <jakub@redhat.com>
PR target/108292
PR target/108308
* gcc.c-torture/execute/pr108292.c: New test.
* gcc.target/i386/pr108292.c: New test.
* gcc.dg/pr108308.c: New test.
--- gcc/testsuite/gcc.c-torture/execute/pr108292.c.jj 2023-01-06 10:40:20.742991257 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr108292.c 2023-01-06 10:41:56.589597398 +0100
@@ -0,0 +1,18 @@
+/* PR target/108292 */
+
+typedef unsigned V __attribute__((__vector_size__ (64)));
+
+V x;
+
+int
+main ()
+{
+ if (sizeof (unsigned) * __CHAR_BIT__ != 32)
+ return 0;
+ __builtin_sub_overflow (0, 6, &x[5]);
+ x >>= ((V){} != x) & 31;
+ for (unsigned i = 0; i < 16; i++)
+ if (x[i] != (i == 5))
+ __builtin_abort ();
+ return 0;
+}
--- gcc/testsuite/gcc.target/i386/pr108292.c.jj 2023-01-06 10:50:12.382388648 +0100
+++ gcc/testsuite/gcc.target/i386/pr108292.c 2023-01-06 10:50:05.704485693 +0100
@@ -0,0 +1,15 @@
+/* PR target/108292 */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -march=alderlake" } */
+
+extern void foo (float *);
+
+extern int x;
+
+int
+bar (void)
+{
+ float y;
+ foo (&y);
+ return y > x ? 1 : 2;
+}
--- gcc/testsuite/gcc.dg/pr108308.c.jj 2023-01-06 10:43:45.793009294 +0100
+++ gcc/testsuite/gcc.dg/pr108308.c 2023-01-06 10:43:40.218090375 +0100
@@ -0,0 +1,39 @@
+/* PR target/108308 */
+/* { dg-do run { target { ilp32 || lp64 } } } */
+/* { dg-options "-Os -fno-tree-ccp" } */
+
+int a = 1, *d = &a, f = 2766708631, h;
+unsigned b = -1, c, e, g;
+
+static void
+foo (int j)
+{
+ if (a)
+ {
+ c = ~c;
+ while (e)
+ j = 0;
+ goto k;
+ }
+l:
+ h = 1;
+k:
+ *d = (!j) | 80;
+ int m = ~(~(-1 / b) | (a ^ 1)), n = ~(~g / (11 >> m)), o = -1 / n;
+ if (f)
+ {
+ b = 9518150474215344 ^ ~f;
+ f = 0;
+ if (c)
+ goto l;
+ if (o)
+ goto k;
+ }
+}
+
+int
+main ()
+{
+ foo (1);
+ return 0;
+}
Jakub
next reply other threads:[~2023-01-06 9:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-06 9:56 Jakub Jelinek [this message]
2023-01-11 8:58 ` NightStrike
2023-01-11 9:06 ` Jakub Jelinek
2023-01-11 9:27 ` NightStrike
2023-01-11 9:43 ` Jakub Jelinek
2023-01-11 10:10 ` NightStrike
2023-01-11 12:14 ` Jakub Jelinek
2023-01-11 12:22 ` NightStrike
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y7fwNTmas50x4CUm@tucnak \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).