Commit 9aa4d3c1 by Richard Guenther Committed by Richard Biener

re PR middle-end/37042 (Strict-aliasing warnings are printed for _mm_load_si128,…

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
parent 18bd082d
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> 2008-08-06 Jan Hubicka <jh@suse.cz>
* optabs.c (emit_unop_insn): Break out to ... * optabs.c (emit_unop_insn): Break out to ...
......
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> 2008-08-07 Andreas Krebbel <krebbel1@de.ibm.com>
* gcc.c-torture/compile/20080806-1.c: Move testcase ... * gcc.c-torture/compile/20080806-1.c: Move testcase ...
......
/* { 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) ...@@ -889,6 +889,10 @@ nonstandard_alias_p (tree ptr, tree alias, bool ptr_ptr)
tree ptr_type = get_otype (ptr, true); tree ptr_type = get_otype (ptr, true);
tree alias_type = get_otype (alias, ptr_ptr); 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. /* XXX: for now, say it's OK if the alias escapes.
Not sure this is needed in general, but otherwise GCC will not Not sure this is needed in general, but otherwise GCC will not
bootstrap. */ bootstrap. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment