[Bug target/65408] powerpc64 function argument passing may access invalid memory

2016-01-21 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65408

Bill Schmidt  changed:

   What|Removed |Added

 CC||cyrilbur at gmail dot com

--- Comment #11 from Bill Schmidt  ---
*** Bug 65096 has been marked as a duplicate of this bug. ***

[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-04-30 Thread rguenth at gcc dot gnu.org
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).


[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-04-30 Thread amodra at gmail dot com
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


[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-04-30 Thread amodra at gmail dot com
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


[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-04-30 Thread amodra at gcc dot gnu.org
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=222616root=gccview=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


[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-04-15 Thread amodra at gcc dot gnu.org
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=222115root=gccview=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


[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-03-18 Thread amodra at gmail dot com
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!


[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-03-18 Thread rguenth at gcc dot gnu.org
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?))


[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-03-13 Thread amodra at gmail dot com
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=35032action=edit
prototype patch

Patch I'm about to test


[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-03-13 Thread rguenth at gcc dot gnu.org
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.


[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-03-12 Thread ktkachov at gcc dot gnu.org
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 ?


[Bug target/65408] powerpc64 function argument passing may access invalid memory

2015-03-12 Thread amodra at gmail dot com
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..