]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix tree-ssa/alias-access-path-13.c on 32bit platforms (PR 106216)
authorMartin Jambor <mjambor@suse.cz>
Fri, 8 Jul 2022 16:12:26 +0000 (18:12 +0200)
committerMartin Jambor <mjambor@suse.cz>
Fri, 8 Jul 2022 16:13:31 +0000 (18:13 +0200)
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.

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

index e502a97bc750335232b97181f7aa32c86c902c87..87a94f5bf315f78bbc4438e27674f33f940c92fd 100644 (file)
@@ -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