Fix for sparc va_arg macro aliasing problem.
* c-common.c (c_get_alias_set): Handle ARRAY_REF of union field. From-SVN: r23427
This commit is contained in:
parent
7140b0dba6
commit
1e2800358a
|
@ -1,3 +1,7 @@
|
||||||
|
Thu Oct 29 12:39:35 1998 Jim Wilson <wilson@cygnus.com>
|
||||||
|
|
||||||
|
* c-common.c (c_get_alias_set): Handle ARRAY_REF of union field.
|
||||||
|
|
||||||
Thu Oct 29 14:10:22 EST 1998 Andrew MacLeod <amacleod@cygnus.com>
|
Thu Oct 29 14:10:22 EST 1998 Andrew MacLeod <amacleod@cygnus.com>
|
||||||
|
|
||||||
* except.c (emit_eh_context): Make the EH context register stay alive
|
* except.c (emit_eh_context): Make the EH context register stay alive
|
||||||
|
|
|
@ -3155,8 +3155,15 @@ c_get_alias_set (t)
|
||||||
the conservative assumption. */
|
the conservative assumption. */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (TREE_CODE (t) == COMPONENT_REF
|
if ((TREE_CODE (t) == COMPONENT_REF
|
||||||
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == UNION_TYPE)
|
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == UNION_TYPE)
|
||||||
|
/* Also permit punning when accessing an array which is a union
|
||||||
|
member. This makes the current sparc va_arg macro work, but may
|
||||||
|
not be otherwise necessary. */
|
||||||
|
|| (TREE_CODE (t) == ARRAY_REF
|
||||||
|
&& TREE_CODE (TREE_OPERAND (t, 0)) == COMPONENT_REF
|
||||||
|
&& (TREE_CODE (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 0), 0)))
|
||||||
|
== UNION_TYPE)))
|
||||||
/* Permit type-punning when accessing a union, provided the
|
/* Permit type-punning when accessing a union, provided the
|
||||||
access is directly through the union. For example, this code does
|
access is directly through the union. For example, this code does
|
||||||
not permit taking the address of a union member and then
|
not permit taking the address of a union member and then
|
||||||
|
|
Loading…
Reference in New Issue