public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
@ 2011-03-28 12:03 ` rguenth at gcc dot gnu.org
  2011-03-28 12:17 ` rguenth at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-28 12:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36043

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64-unknown-linux-gnu    |x86_64-unknown-linux-gnu,
                   |                            |i?86-*-*
          Component|target                      |middle-end
      Known to fail|                            |2.95.2

--- Comment #16 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-28 11:57:36 UTC ---
Also broken at least since GCC 2.95 on i?86 with

struct colour
{
  unsigned char red;
  unsigned char green;
  unsigned char blue;
};

void print_colour(struct colour col) __attribute__((regparm(3)));

void
foo(struct colour *c)
{
  print_colour(*c);
}


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

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
  2011-03-28 12:03 ` [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv rguenth at gcc dot gnu.org
@ 2011-03-28 12:17 ` rguenth at gcc dot gnu.org
  2012-02-02 15:08 ` bergner at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-28 12:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36043

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |37954

--- Comment #17 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-28 11:58:50 UTC ---
PR37954 looks like a dup for arm.


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

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
  2011-03-28 12:03 ` [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv rguenth at gcc dot gnu.org
  2011-03-28 12:17 ` rguenth at gcc dot gnu.org
@ 2012-02-02 15:08 ` bergner at gcc dot gnu.org
  2012-02-02 15:47 ` bergner at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bergner at gcc dot gnu.org @ 2012-02-02 15:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36043

Peter Bergner <bergner at gcc dot gnu.org> changed:

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

--- Comment #18 from Peter Bergner <bergner at gcc dot gnu.org> 2012-02-02 15:07:34 UTC ---
*** Bug 50499 has been marked as a duplicate of this bug. ***


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

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2012-02-02 15:08 ` bergner at gcc dot gnu.org
@ 2012-02-02 15:47 ` bergner at gcc dot gnu.org
  2014-02-22 21:09 ` david at fries dot net
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bergner at gcc dot gnu.org @ 2012-02-02 15:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36043

Peter Bergner <bergner at gcc dot gnu.org> changed:

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

--- Comment #19 from Peter Bergner <bergner at gcc dot gnu.org> 2012-02-02 15:46:09 UTC ---
>From PR50499, we have this similar test case that fails on powerpc64-linux:

struct S50 { char i[9]; };
extern void bar (struct S50);
void
foo (struct S50 *p)
{
  bar (*p);
}

Gives (using -m64 -O1):

        ...
    ld 3,0(3)
    ld 4,8(9)
    bl bar


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

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2012-02-02 15:47 ` bergner at gcc dot gnu.org
@ 2014-02-22 21:09 ` david at fries dot net
  2014-02-23  0:03 ` support@zzz-deskmobile.desk-mail.com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: david at fries dot net @ 2014-02-22 21:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36043

David Fries <david at fries dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |david at fries dot net

--- Comment #20 from David Fries <david at fries dot net> ---
I just ran into this and verified that it exists in gcc svn trunk
gcc (GCC) 4.9.0 20140221 (experimental)


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

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-02-22 21:09 ` david at fries dot net
@ 2014-02-23  0:03 ` support@zzz-deskmobile.desk-mail.com
  2014-02-25 19:45 ` arthur.j.odwyer at gmail dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: support@zzz-deskmobile.desk-mail.com @ 2014-02-23  0:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36043

--- Comment #21 from support@zzz-deskmobile.desk-mail.com ---
__________________________________
Type your response ABOVE THIS LINE to reply

------------------------------------------------------------------------------------------------------------
Customer: tromey at gcc dot gnu.org
Subject: [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which
leads to sigsegv
------------------------------------------------------------------------------------------------------------

Jamie Forrest | FEB 23, 2014 | 12:02AM UTC



------------------------------------------------------------------------------------------------------------

tromey | FEB 22, 2014 | 09:10PM UTC  | Original message 

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36043

David Fries <david at fries dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |david at fries dot net

--- Comment #20 from David Fries <david at fries dot net> ---
I just ran into this and verified that it exists in gcc svn trunk
gcc (GCC) 4.9.0 20140221 (experimental)


------------------------------------------------------------------------------------------------------------
This message was sent to gcc-bugzilla@gcc.gnu.org in reference to Case #: 4164.
------------------------------------------------------------------------------------------------------------




[[0958b287b2c175eb67793a138c0536bfc6a0b07d-206330137]]


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

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2014-02-23  0:03 ` support@zzz-deskmobile.desk-mail.com
@ 2014-02-25 19:45 ` arthur.j.odwyer at gmail dot com
  2015-03-14  3:57 ` amodra at gmail dot com
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: arthur.j.odwyer at gmail dot com @ 2014-02-25 19:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36043

Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arthur.j.odwyer at gmail dot com

--- Comment #22 from Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> ---
Here's another segfaulting test case, for x86-64. This fails with GCC 4.6.2 and
GCC 4.8.1.
This GCC bug is really hard to work around, since it can strike anywhere
without warning. Is it possible that one of the patches above (e.g., Richard
Biener's comment #9) could be adopted into 4.8.x or 4.9.x?


#include <cstdio>
#include <stdint.h>
#include <sys/mman.h>

struct int24_t { uint8_t m_Internal[3]; };

void foo(int24_t a) { puts("2"); }

int main() {
    const int OS_PAGE_SIZE = 0x1000;
    const int COUNT = (OS_PAGE_SIZE) / sizeof(int24_t);
    printf("sizeof int24_t = %d\n", (int)sizeof(int24_t));

    void* arena1 = mmap(0, OS_PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE |
MAP_ANONYMOUS, -1, 0);
    int24_t* ptr = (int24_t*)mmap(0, OS_PAGE_SIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    munmap(arena1, OS_PAGE_SIZE);

    puts("1");
    foo(ptr[COUNT-1]);
    puts("3");
}


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

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2014-02-25 19:45 ` arthur.j.odwyer at gmail dot com
@ 2015-03-14  3:57 ` amodra at gmail dot com
  2015-04-15  7:29 ` amodra at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: amodra at gmail dot com @ 2015-03-14  3:57 UTC (permalink / raw)
  To: gcc-bugs

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

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


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

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2015-03-14  3:57 ` amodra at gmail dot com
@ 2015-04-15  7:29 ` amodra at gcc dot gnu.org
  2015-04-30 11:12 ` amodra at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 12+ 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=36043

--- Comment #24 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] 12+ messages in thread

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2015-04-15  7:29 ` amodra 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:18 ` john.dallman at siemens dot com
  11 siblings, 0 replies; 12+ 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=36043

--- Comment #25 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] 12+ messages in thread

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 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:18 ` john.dallman at siemens dot com
  11 siblings, 0 replies; 12+ 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=36043

Alan Modra <amodra at gmail dot com> changed:

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

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


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

* [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv
       [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2015-04-30 11:15 ` amodra at gmail dot com
@ 2015-04-30 11:18 ` john.dallman at siemens dot com
  11 siblings, 0 replies; 12+ messages in thread
From: john.dallman at siemens dot com @ 2015-04-30 11:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #27 from John Dallman <john.dallman at siemens dot com> ---
Thanks!


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

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

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-36043-4@http.gcc.gnu.org/bugzilla/>
2011-03-28 12:03 ` [Bug middle-end/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv rguenth at gcc dot gnu.org
2011-03-28 12:17 ` rguenth at gcc dot gnu.org
2012-02-02 15:08 ` bergner at gcc dot gnu.org
2012-02-02 15:47 ` bergner at gcc dot gnu.org
2014-02-22 21:09 ` david at fries dot net
2014-02-23  0:03 ` support@zzz-deskmobile.desk-mail.com
2014-02-25 19:45 ` arthur.j.odwyer at gmail dot com
2015-03-14  3:57 ` amodra at gmail dot com
2015-04-15  7:29 ` amodra 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:18 ` john.dallman at siemens 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).