public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
@ 2015-03-12 17:52 ` ktkachov at gcc dot gnu.org
  2015-03-13  0:42 ` amodra at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2015-03-12 17:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #1 from ktkachov at gcc dot gnu.org ---
shot in the dark here, but this wouldn't happen to be similar to:
PR 65358 ?


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
  2015-03-12 17:52 ` [Bug target/65408] powerpc64 function argument passing may access invalid memory ktkachov at gcc dot gnu.org
@ 2015-03-13  0:42 ` amodra at gmail dot com
  2015-03-13  9:27 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: amodra at gmail dot com @ 2015-03-13  0:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at gmail dot com

--- Comment #2 from Alan Modra <amodra at gmail dot com> ---
PR 65358 smells different to me, probably an arm backend bug.  This one does
look like it might have the same underlying problem as PR 58744, but I haven't
analysed either bug so just a wild guess on my part..


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
  2015-03-12 17:52 ` [Bug target/65408] powerpc64 function argument passing may access invalid memory ktkachov at gcc dot gnu.org
  2015-03-13  0:42 ` amodra at gmail dot com
@ 2015-03-13  9:27 ` rguenth at gcc dot gnu.org
  2015-03-14  3:19 ` amodra at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-13  9:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
ISTR there is an even older bug for this - PR36043.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2015-03-13  9:27 ` rguenth at gcc dot gnu.org
@ 2015-03-14  3:19 ` amodra at gmail dot com
  2015-03-18  9:59 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: amodra at gmail dot com @ 2015-03-14  3:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-03-14
           Assignee|unassigned at gcc dot gnu.org      |amodra at gmail dot com
     Ever confirmed|0                           |1

--- Comment #4 from Alan Modra <amodra at gmail dot com> ---
Created attachment 35032
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35032&action=edit
prototype patch

Patch I'm about to test


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2015-03-14  3:19 ` amodra at gmail dot com
@ 2015-03-18  9:59 ` rguenth at gcc dot gnu.org
  2015-03-18 11:07 ` amodra at gmail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-18  9:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note that code quality is an issue here as well.  Cases to consider are

struct test obj;

void foo()
{
  func (obj);
}

and

void foo()
{
  struct test obj;
  func (obj);
}

and

void foo (struct test obj)
{
  func (obj);
}

where we might (or might not) be sure that there is at least one 'int' mapped
after 'obj' (not for the global var case at least - but I'm less sure about
the other two cases (red zone? return address?))


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2015-03-18  9:59 ` rguenth at gcc dot gnu.org
@ 2015-03-18 11:07 ` amodra at gmail dot com
  2015-04-15  7:29 ` amodra at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: amodra at gmail dot com @ 2015-03-18 11:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

--- Comment #6 from Alan Modra <amodra at gmail dot com> ---
Code quality for both powerpc64le and x86_64 looks passable for the testcase
here and other structs with at least one int field (ie. when the struct size is
a multiple of 4, and alignment is 4).  You get DImode loads followed by an
SImode load if the struct isn't a multiple of 8 in size.

Code quality does suffer a little for big-endian since any SImode load at the
end of the struct needs to be shifted, whereas a DImode loading past the end of
the struct needs no shifting.

For cases where the struct size isn't a multiple of 4, code quality certainly
does suffer, worst case being a struct of size 7 that would now be loaded by 7
byte loads..  Should we care more about that than a segfault in real-world user
code?  Hmm.  Answering my own question, I guess that since pr36043 is nearly
seven years old, we don't care too much about segfaults!


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2015-03-18 11:07 ` amodra at gmail dot com
@ 2015-04-15  7:29 ` amodra at gcc dot gnu.org
  2015-04-30  7:33 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: amodra at gcc dot gnu.org @ 2015-04-15  7:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

--- Comment #7 from Alan Modra <amodra at gcc dot gnu.org> ---
Author: amodra
Date: Wed Apr 15 07:29:01 2015
New Revision: 222115

URL: https://gcc.gnu.org/viewcvs?rev=222115&root=gcc&view=rev
Log:
    PR target/65408
    PR target/58744
    PR middle-end/36043
    * calls.c (load_register_parameters): Don't load past end of
    mem unless suitably aligned.


Added:
    trunk/gcc/testsuite/gcc.dg/pr65408.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/calls.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2015-04-15  7:29 ` amodra at gcc dot gnu.org
@ 2015-04-30  7:33 ` rguenth at gcc dot gnu.org
  2015-04-30 11:12 ` amodra at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-30  7:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
We've had some 15 days without any fallout noticed.  Backporting this for GCC
5.2 now (or whenever it suits you) is pre-approved (even if it's not a
regression).


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2015-04-30  7:33 ` rguenth at gcc dot gnu.org
@ 2015-04-30 11:12 ` amodra at gcc dot gnu.org
  2015-04-30 11:15 ` amodra at gmail dot com
  2015-04-30 11:15 ` amodra at gmail dot com
  10 siblings, 0 replies; 11+ messages in thread
From: amodra at gcc dot gnu.org @ 2015-04-30 11:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

--- Comment #9 from Alan Modra <amodra at gcc dot gnu.org> ---
Author: amodra
Date: Thu Apr 30 11:11:34 2015
New Revision: 222616

URL: https://gcc.gnu.org/viewcvs?rev=222616&root=gcc&view=rev
Log:
gcc/
        PR target/65408
        PR target/58744
        PR middle-end/36043
        * calls.c (load_register_parameters): Don't load past end of
        mem unless suitably aligned.
gcc/testsuite/
        * gcc.dg/pr65408.c: New.


Added:
    branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr65408.c
Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/calls.c
    branches/gcc-5-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2015-04-30 11:12 ` amodra at gcc dot gnu.org
@ 2015-04-30 11:15 ` amodra at gmail dot com
  2015-04-30 11:15 ` amodra at gmail dot com
  10 siblings, 0 replies; 11+ messages in thread
From: amodra at gmail dot com @ 2015-04-30 11:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.2

--- Comment #10 from Alan Modra <amodra at gmail dot com> ---
Fixed for 5.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/65408] powerpc64 function argument passing may access invalid memory
       [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2015-04-30 11:15 ` amodra at gmail dot com
@ 2015-04-30 11:15 ` amodra at gmail dot com
  10 siblings, 0 replies; 11+ messages in thread
From: amodra at gmail dot com @ 2015-04-30 11:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408
Bug 65408 depends on bug 36043, which changed state.

Bug 36043 Summary: gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36043

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-04-30 11:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-65408-4@http.gcc.gnu.org/bugzilla/>
2015-03-12 17:52 ` [Bug target/65408] powerpc64 function argument passing may access invalid memory ktkachov at gcc dot gnu.org
2015-03-13  0:42 ` amodra at gmail dot com
2015-03-13  9:27 ` rguenth at gcc dot gnu.org
2015-03-14  3:19 ` amodra at gmail dot com
2015-03-18  9:59 ` rguenth at gcc dot gnu.org
2015-03-18 11:07 ` amodra at gmail dot com
2015-04-15  7:29 ` amodra at gcc dot gnu.org
2015-04-30  7:33 ` rguenth at gcc dot gnu.org
2015-04-30 11:12 ` amodra at gcc dot gnu.org
2015-04-30 11:15 ` amodra at gmail dot com
2015-04-30 11:15 ` amodra at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).