From: Richard Biener Date: Fri, 12 Jun 2020 11:02:56 +0000 (+0200) Subject: testcase for shared DR alignment X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4544793ef618484b2cc753a4635ab79b361f8df8;p=gcc.git testcase for shared DR alignment This adds a reduced C testcase from libgomp.fortran/examples-4/target-1.f90 and libgomp.fortran/examples-4/target_data-1.f90 FAILs, showing a case of SLP instance stmt sharing that affects the shared dataref alignment info. 2020-06-12 Richard Biener * gcc.dg/vect/bb-slp-44.c: New testcase. --- diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-44.c b/gcc/testsuite/gcc.dg/vect/bb-slp-44.c new file mode 100644 index 00000000000..dfa0a5eaaab --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-44.c @@ -0,0 +1,41 @@ +/* { dg-do run } */ + +typedef struct { + unsigned long a; + unsigned long b; + unsigned long c; +} data_o; +typedef struct { + unsigned long c; + unsigned long gap1; + unsigned long b; + unsigned long gap2; + unsigned long a; + unsigned long x; +} data_i; + +volatile unsigned long gx; +void __attribute__((noipa)) +bar(unsigned long x) +{ + gx = x; +} + +void __attribute__((noipa)) +foo(data_o *o, data_i *i) +{ + o->a = i->a; + o->b = i->b; + o->c = i->c; + bar (i->x); +} + +int main() +{ + unsigned long data[9]; + if ((__UINTPTR_TYPE__)data & 15 != 0) + foo ((data_o *)&data[6], (data_i *)data); + else + foo ((data_o *)data, (data_i *)&data[3]); + return 0; +}