This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/61300] powerpc64le miscompile with K&R-style function definition at -O0


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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]