[Bug middle-end/40135] using alias-set zero for union accesses necessary because of RTL alias oracle

2019-10-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40135

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Blocks||71002
 Resolution|--- |FIXED

--- Comment #7 from Richard Biener  ---
Fixed by

2016-06-29  Richard Biener  

PR middle-end/71002
* c-common.c (c_common_get_alias_set): Remove union type punning case.

* alias.c (component_uses_parent_alias_set_from): Handle
type punning through union accesses by using the union alias set.
* gimple.c (gimple_get_alias_set): Remove union type punning case.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71002
[Bug 71002] [6 Regression] -fstrict-aliasing breaks Boost's short string
optimization implementation

[Bug middle-end/40135] using alias-set zero for union accesses necessary because of RTL alias oracle

2014-09-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40135

--- Comment #6 from Richard Biener rguenth at gcc dot gnu.org ---
For reference I see for example

FAIL: gcc.target/i386/avx2-vpblendd128-2.c execution test
FAIL: gcc.target/i386/avx2-vpblendd256-2.c execution test
FAIL: gcc.target/i386/avx2-vpblendw-2.c execution test
FAIL: gcc.target/i386/avx2-vpbroadcastd128-2.c execution test
FAIL: gcc.target/i386/avx2-vpbroadcastd256-2.c execution test
FAIL: gcc.target/i386/avx2-vpbroadcastw128-2.c execution test
FAIL: gcc.target/i386/avx2-vpbroadcastw256-2.c execution test
FAIL: gcc.target/i386/avx2-vpermd-2.c execution test
FAIL: gcc.target/i386/avx2-vpermps-2.c execution test
FAIL: gcc.target/i386/avx2-vpmaxsd-2.c execution test
FAIL: gcc.target/i386/avx2-vpmaxsw-2.c execution test
FAIL: gcc.target/i386/avx2-vpmaxud-2.c execution test
FAIL: gcc.target/i386/avx2-vpmaxuw-2.c execution test
FAIL: gcc.target/i386/avx2-vpminsd-2.c execution test
FAIL: gcc.target/i386/avx2-vpminsw-2.c execution test
FAIL: gcc.target/i386/avx2-vpminud-2.c execution test
FAIL: gcc.target/i386/avx2-vpminuw-2.c execution test
FAIL: gcc.target/i386/avx2-vpmuldq-2.c execution test
FAIL: gcc.target/i386/avx2-vpmulhrsw-2.c execution test
FAIL: gcc.target/i386/avx2-vpmulhuw-2.c execution test
FAIL: gcc.target/i386/avx2-vpmulhw-2.c execution test
FAIL: gcc.target/i386/avx2-vpmulld-2.c execution test
...
FAIL: gcc.target/i386/avx2-vpunpckhdq-2.c execution test
FAIL: gcc.target/i386/avx2-vpunpckhwd-2.c execution test
FAIL: gcc.target/i386/avx2-vpunpckldq-2.c execution test
FAIL: gcc.target/i386/avx2-vpunpcklwd-2.c execution test

but for example gcc.target/i386/avx2-vpblendd128-2.c contains invalid
type-punning through unions:

static void
init_pblendd128 (int *src1, int *src2, int seed)
{
  int i, sign = 1;

  for (i = 0; i  4; i++)
{
  src1[i] = (i + seed) * (i + seed) * sign;
  src2[i] = (i + seed + 20) * sign;
  sign = -sign;
}
}
...
static void
avx2_test (void)
{
  union128i_d src1, src2, dst;
  int dst_ref[4];
  int i;

  for (i = 0; i  NUM; i++)
{
  init_pblendd128 (src1.a, src2.a, i);

  dst.x = _mm_blend_epi32 (src1.x, src2.x, MASK);

which stores into src1/src2 via a pointer access and only reads via a direct
access to the union.

That's not how the GCC extension specifies union type-punning. I've filed
PR63211 for that.

Here the stores do not end up in alias-set zero and with removing the
c-common.c hack the loads also end up not using alias-set zero.  Without
the fix the loads use alias-set zero and thus keep the int-stores live.

There is also no easy must-alias to identify here as the stores happen
in a loop.


[Bug middle-end/40135] using alias-set zero for union accesses necessary because of RTL alias oracle

2014-09-08 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40135

--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org ---
At least improved (but maybe not fixed) by

2010-02-16  Richard Guenther  rguent...@suse.de

* alias.c (memrefs_conflict_p): Distinguish must-alias from don't know.
(true_dependence): If memrefs_conflict_p computes must-alias
trust it.  Move TBAA check after offset-based disambiguation.
(canon_true_dependence): Likewise.


[Bug middle-end/40135] using alias-set zero for union accesses necessary because of RTL alias oracle

2014-09-08 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40135

--- Comment #4 from Richard Biener rguenth at gcc dot gnu.org ---
Ok it still has in the function comment

   ???  Contrary to the tree alias oracle this does not return
   one for X + non-constant and Y + non-constant when X and Y are equal.
   If that is fixed the TBAA hack for union type-punning can be removed.  */

which explains what is remaining to do.


[Bug middle-end/40135] using alias-set zero for union accesses necessary because of RTL alias oracle

2014-09-08 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40135

--- Comment #5 from Richard Biener rguenth at gcc dot gnu.org ---
Eventually just removing the call to mems_in_disjoint_alias_sets_p fixes the
rest (rtx_refs_may_alias_p will apply TBAA as well, _after_ positively
bailing out on the union punning).


[Bug middle-end/40135] using alias-set zero for union accesses necessary because of RTL alias oracle

2012-01-07 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40135

Andrew Pinski pinskia at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-01-07
 Ever Confirmed|0   |1

--- Comment #2 from Andrew Pinski pinskia at gcc dot gnu.org 2012-01-07 
21:41:20 UTC ---
Confirmed.


[Bug middle-end/40135] using alias-set zero for union accesses necessary because of RTL alias oracle

2009-05-13 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2009-05-13 20:31 ---
The tree alias oracle gets this right.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40135