This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug jit/66812] jit code-generation example that unexpectedly required -fno-strict-aliasing to work
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 09 Jul 2015 20:43:06 +0000
- Subject: [Bug jit/66812] jit code-generation example that unexpectedly required -fno-strict-aliasing to work
- Auto-submitted: auto-generated
- References: <bug-66812-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66812
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |alias, wrong-code
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
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.