This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/61300] powerpc64le miscompile with K&R-style function definition at -O0
- From: "amodra at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 26 May 2014 00:13:57 +0000
- Subject: [Bug other/61300] powerpc64le miscompile with K&R-style function definition at -O0
- Auto-submitted: auto-generated
- References: <bug-61300-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61300
Alan Modra <amodra at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |amodra at gmail dot com
Assignee|unassigned at gcc dot gnu.org |amodra at gmail dot com
--- Comment #1 from Alan Modra <amodra at gmail dot com> ---
So, the "writes way past this" is writing into the parameter save area.
compare_kr is assuming that it was called with a parameter save area because it
isn't prototyped, but that is quite wrong because when compiling the function
body we don't know how the function was called. A call may well have a
prototype in scope, and thus not set up a parameter save area.
It's a bug in rs6000_function_parms_need_stack. This function can't blindly
test !prototype_p (fun).