re PR middle-end/37042 (Strict-aliasing warnings are printed for _mm_load_si128, even though __m128i is __attribute__((__may_alias__)).)
2008-08-07 Richard Guenther <rguenther@suse.de> PR middle-end/37042 * tree-ssa-alias-warnings.c (nonstandard_alias_p): Ref-all pointers can access anything. * gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c: New testcase. From-SVN: r138837
This commit is contained in:
parent
18bd082d90
commit
9aa4d3c1cb
4 changed files with 39 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2008-08-07 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR middle-end/37042
|
||||
* tree-ssa-alias-warnings.c (nonstandard_alias_p): Ref-all
|
||||
pointers can access anything.
|
||||
|
||||
2008-08-06 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* optabs.c (emit_unop_insn): Break out to ...
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2008-08-07 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR middle-end/37042
|
||||
* gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c: New testcase.
|
||||
|
||||
2008-08-07 Andreas Krebbel <krebbel1@de.ibm.com>
|
||||
|
||||
* gcc.c-torture/compile/20080806-1.c: Move testcase ...
|
||||
|
|
24
gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c
Normal file
24
gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -Wall" } */
|
||||
|
||||
typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
|
||||
|
||||
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_load_si128 (__m128i const *__P)
|
||||
{
|
||||
return *__P;
|
||||
}
|
||||
|
||||
static const short __attribute__((__aligned__(16))) tbl[8] =
|
||||
{ 1, 2, 3, 4, 5, 6, 7, 8};
|
||||
|
||||
|
||||
__m128i get_vec(void)
|
||||
{
|
||||
__m128i ret;
|
||||
|
||||
ret = _mm_load_si128((__m128i *)tbl); /* { dg-bogus "type-punning" } */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -889,6 +889,10 @@ nonstandard_alias_p (tree ptr, tree alias, bool ptr_ptr)
|
|||
tree ptr_type = get_otype (ptr, true);
|
||||
tree alias_type = get_otype (alias, ptr_ptr);
|
||||
|
||||
/* If this is a ref-all pointer the access is ok. */
|
||||
if (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (ptr)))
|
||||
return false;
|
||||
|
||||
/* XXX: for now, say it's OK if the alias escapes.
|
||||
Not sure this is needed in general, but otherwise GCC will not
|
||||
bootstrap. */
|
||||
|
|
Loading…
Add table
Reference in a new issue