[Bug jit/66812] jit code-generation example that unexpectedly required -fno-strict-aliasing to work
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 9 21:02:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66812
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2015-07-09
Ever confirmed|0 |1
--- Comment #7 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #6)
> This sounds like there is an aliasing set problem.
>
> In the C front-end we have:
>
>
> 5174 /* Permit type-punning when accessing a union, provided the access
> 5175 is directly through the union. For example, this code does not
> 5176 permit taking the address of a union member and then storing
> 5177 through it. Even the type-punning allowed here is a GCC
> 5178 extension, albeit a common and useful one; the C standard says
> 5179 that such accesses have implementation-defined behavior. */
> 5180 for (u = t;
> 5181 TREE_CODE (u) == COMPONENT_REF || TREE_CODE (u) == ARRAY_REF;
> 5182 u = TREE_OPERAND (u, 0))
> 5183 if (TREE_CODE (u) == COMPONENT_REF
> 5184 && TREE_CODE (TREE_TYPE (TREE_OPERAND (u, 0))) == UNION_TYPE)
> 5185 return 0;
> 5186
>
>
> In c_common_get_alias_set . Maybe that is missing on the libjit side.
Thanks. Yes; I'd just figured that out, by single-stepping.
More information about the Gcc-bugs
mailing list