public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-10000] ipa/105598 - testcase for PR105598 Date: Mon, 16 May 2022 10:06:00 +0000 (GMT) [thread overview] Message-ID: <20220516100600.515FE3857C4E@sourceware.org> (raw) https://gcc.gnu.org/g:a9d7992ef579ac9b7e9c6887ae6ba82fe2c67fe8 commit r11-10000-ga9d7992ef579ac9b7e9c6887ae6ba82fe2c67fe8 Author: Richard Biener <rguenther@suse.de> Date: Mon May 16 11:21:06 2022 +0200 ipa/105598 - testcase for PR105598 2022-05-16 Richard Biener <rguenther@suse.de> gcc/testsuite/ * gcc.dg/torture/pr105598.c: New testcase. (cherry picked from commit 6230911cb91d428631e741d7d981fab578102084) Diff: --- gcc/testsuite/gcc.dg/torture/pr105598.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/gcc/testsuite/gcc.dg/torture/pr105598.c b/gcc/testsuite/gcc.dg/torture/pr105598.c new file mode 100644 index 00000000000..0a4ea3b0bd1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr105598.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ + +typedef struct { unsigned int num; } info_t; +typedef struct { unsigned int flag, type; } block_t; +info_t info; +block_t blocks[] = { {2,0}, {3,0}, {1,0}, {1,0} }; + +static block_t * +f (info_t *i, block_t *b) +{ + while (1) { + unsigned int is_last = b->flag & 0x01; + i->num++; + if (b->flag & 0x02) { + if (b->type != 0x1) b->type = b->type; + b = f (i, b+1); + } + if (is_last) + break; + b++; + } + return b; +} + +int +main () +{ + f(&info, &blocks[0]); + if (info.num != 4) + __builtin_abort (); + return 0; +}
reply other threads:[~2022-05-16 10:06 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220516100600.515FE3857C4E@sourceware.org \ --to=rguenth@gcc.gnu.org \ --cc=gcc-cvs@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: linkBe 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).