[Bug middle-end/88487] union prevents autovectorization

2018-12-20 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 --- Comment #6 from Daniel Fruzynski --- Not good. Fortunately I found workaround. This is probably the best what one can get: [code] #include #include template struct TypeHelper { constexpr unsigned offset(); operator Type&() {

[Bug middle-end/88487] union prevents autovectorization

2018-12-17 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 --- Comment #5 from rguenther at suse dot de --- On Fri, 14 Dec 2018, bugzi...@poradnik-webmastera.com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 > > --- Comment #4 from Daniel Fruzynski --- > OK, I see. Is there any workaroun

[Bug middle-end/88487] union prevents autovectorization

2018-12-14 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 --- Comment #4 from Daniel Fruzynski --- OK, I see. Is there any workaround for this? I tried to assign pointer to local variable directly and with intermediate casting via void*, but it did not help. Casting S1* to S2* also does not work.

[Bug middle-end/88487] union prevents autovectorization

2018-12-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 Richard Biener changed: What|Removed |Added Keywords||missed-optimization Status|

[Bug middle-end/88487] union prevents autovectorization

2018-12-13 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 --- Comment #2 from Daniel Fruzynski --- I spotted that test3 in previous comment uses structure S2 which does not have union inside. When I changes it to use S1, I got non-vectorized code. So this workaround does not work.

[Bug middle-end/88487] union prevents autovectorization

2018-12-13 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 --- Comment #1 from Daniel Fruzynski --- Update: when pointers to data are copied to local variables like below, autovectorization starts working again. [code] void test3(S2* __restrict__ s1, S2* __restrict__ s2) { double* __restrict__ * __r