From: Martin Jambor <mjambor@suse.cz>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH] testsuite: Fix tree-ssa/alias-access-path-13.c on 32bit platforms (PR 106216)
Date: Fri, 08 Jul 2022 14:30:40 +0200 [thread overview]
Message-ID: <ri635fb6b2n.fsf@suse.cz> (raw)
Hi,
for gcc.dg/tree-ssa/alias-access-path-13.c to work, SRA must think of
accesses to foo.inn.val and to foo itself as different ones, i.e. they
need to have different offset and size, which on 32bit platforms they
do not. Fixed by replacing a dummy long int field of the union with a
struct of two integers.
Tested by:
make -k check-gcc RUNTESTFLAGS="tree-ssa.exp=alias-access-path-13.c" and
make -k check-gcc RUNTESTFLAGS="--target_board=unix'{-m32}' tree-ssa.exp=alias-access-path-13.c"
on an x86_64-linux, also with patched SRA to verify it still tests the
original intent.
I hope the fix is obvious enough (and it is only a testsuite change)
that I can commit it myself.
Thanks,
Martin
gcc/testsuite/ChangeLog:
2022-07-08 Martin Jambor <mjambor@suse.cz>
PR testsuite/106216
* gcc.dg/tree-ssa/alias-access-path-13.c (union foo): Replace a long
int field with a struct that is larger than an int also on 32bit
platforms.
---
gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c
index e502a97bc75..87a94f5bf31 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c
@@ -6,10 +6,15 @@ struct inn
int val;
};
+struct biggerstruct
+{
+ int a, b;
+};
+
union foo
{
struct inn inn;
- long int baz;
+ struct biggerstruct baz;
} *fooptr;
struct bar
--
2.36.1
reply other threads:[~2022-07-08 12:30 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=ri635fb6b2n.fsf@suse.cz \
--to=mjambor@suse.cz \
--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).