This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52615] function pointer casting bug
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 19 Mar 2012 13:20:36 +0000
- Subject: [Bug c/52615] function pointer casting bug
- Auto-submitted: auto-generated
- References: <bug-52615-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52615
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jsm28 at gcc dot gnu.org
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-19 13:20:36 UTC ---
I believe your program invokes undefined behavior.
But, since 4.7 we can DWIM, the middle-end should be able to handle a local
differing call ABI by means of gimple_call_fntype which can be different from
the type of the FUNCTION_DECL we refer to. I think the only requirement
for the frontends is that the function in the CALL_EXPR is (fntype2 *)&f
with f being of fntype1.