[Bug ipa/65270] issues with merging memory accesses from different code paths
hubicka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 5 20:11:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65270
--- Comment #27 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
here is a variant of orignal testcase for tree-tail-merge
struct a
{
int a[100000];
};
typedef struct a misaligned_t __attribute__ ((aligned (8)));
typedef struct a aligned_t __attribute__ ((aligned (32)));
__attribute__ ((used))
__attribute__ ((noinline))
t(void *a, int misaligned, aligned_t *d)
{
int i,v;
for (i=0;i<100000;i++)
{
if (misaligned)
v=((misaligned_t *)a)->a[i];
else
v=((aligned_t *)a)->a[i];
d->a[i]+=v;
}
}
struct b {int v; misaligned_t m;aligned_t aa;} b;
aligned_t d;
main()
{
t(&b.m, 1, &d);
}
$ ./xgcc -B ./ -O3 t.c -fdump-tree-all-details
t.c:10:1: warning: return type defaults to �int� [-Wimplicit-int]
t(void *a, int misaligned, aligned_t *d)
^
t.c:24:1: warning: return type defaults to �int� [-Wimplicit-int]
main()
^
$ ./a.out
Segmentation fault
It works (by accident) for GCC 4.7, so it is a regression again...
More information about the Gcc-bugs
mailing list