public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
       [not found] <bug-37954-4@http.gcc.gnu.org/bugzilla/>
@ 2011-04-28 16:25 ` rguenth at gcc dot gnu.org
  2015-03-12 11:29 ` ramana at gcc dot gnu.org
  2015-04-30 11:15 ` amodra at gmail dot com
  2 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-28 16:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.6                       |---


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

* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
       [not found] <bug-37954-4@http.gcc.gnu.org/bugzilla/>
  2011-04-28 16:25 ` [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application rguenth at gcc dot gnu.org
@ 2015-03-12 11:29 ` ramana at gcc dot gnu.org
  2015-04-30 11:15 ` amodra at gmail dot com
  2 siblings, 0 replies; 11+ messages in thread
From: ramana at gcc dot gnu.org @ 2015-03-12 11:29 UTC (permalink / raw)
  To: gcc-bugs

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

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |ramana at gcc dot gnu.org
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.4.0

--- Comment #15 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
Fixed. ... Wont fix on the 4.3 branch which is now long dead.


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

* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
       [not found] <bug-37954-4@http.gcc.gnu.org/bugzilla/>
  2011-04-28 16:25 ` [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application rguenth at gcc dot gnu.org
  2015-03-12 11:29 ` ramana at gcc dot gnu.org
@ 2015-04-30 11:15 ` amodra at gmail dot com
  2 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=37954
Bug 37954 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

* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
  2008-10-29 19:43 [Bug c/37954] New: odd sized packed structures, " damon dot michaels at navico dot com
                   ` (6 preceding siblings ...)
  2009-10-23  0:29 ` mikpe at it dot uu dot se
@ 2009-10-23 12:49 ` mikpe at it dot uu dot se
  7 siblings, 0 replies; 11+ messages in thread
From: mikpe at it dot uu dot se @ 2009-10-23 12:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from mikpe at it dot uu dot se  2009-10-23 12:49 -------
Created an attachment (id=18879)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18879&action=view)
backport of r141742 to gcc-4.3.4 that I'm testing


-- 


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


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

* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
  2008-10-29 19:43 [Bug c/37954] New: odd sized packed structures, " damon dot michaels at navico dot com
                   ` (5 preceding siblings ...)
  2009-10-22 17:55 ` mikpe at it dot uu dot se
@ 2009-10-23  0:29 ` mikpe at it dot uu dot se
  2009-10-23 12:49 ` mikpe at it dot uu dot se
  7 siblings, 0 replies; 11+ messages in thread
From: mikpe at it dot uu dot se @ 2009-10-23  0:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from mikpe at it dot uu dot se  2009-10-23 00:29 -------
The ARM misalignment bug in this PR was fixed for gcc-4.4 by r141742, an
apparently ia64- and Ada-motivated generic patch.


-- 


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


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

* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
  2008-10-29 19:43 [Bug c/37954] New: odd sized packed structures, " damon dot michaels at navico dot com
                   ` (4 preceding siblings ...)
  2009-10-21 19:47 ` mikpe at it dot uu dot se
@ 2009-10-22 17:55 ` mikpe at it dot uu dot se
  2009-10-23  0:29 ` mikpe at it dot uu dot se
  2009-10-23 12:49 ` mikpe at it dot uu dot se
  7 siblings, 0 replies; 11+ messages in thread
From: mikpe at it dot uu dot se @ 2009-10-22 17:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from mikpe at it dot uu dot se  2009-10-22 17:55 -------
Created an attachment (id=18869)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18869&action=view)
reduced test case in plain C


-- 


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


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

* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
  2008-10-29 19:43 [Bug c/37954] New: odd sized packed structures, " damon dot michaels at navico dot com
                   ` (3 preceding siblings ...)
  2009-10-21 14:47 ` maurice35 dot david at laposte dot net
@ 2009-10-21 19:47 ` mikpe at it dot uu dot se
  2009-10-22 17:55 ` mikpe at it dot uu dot se
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: mikpe at it dot uu dot se @ 2009-10-21 19:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from mikpe at it dot uu dot se  2009-10-21 19:47 -------
(In reply to comment #9)
> My version is:
> [root@xxxx build]# ccmips -V
> ccmips: `-V' option must have argument
> [root@pace build]# ccmips --version
> ccmips (GCC) 3.3.2 20030904 (Wind River vxworks61) (built 20050516)
> Copyright (C) 2003 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

That's an old vendor-modified compiler based on an ancient and no longer
supported gcc version. Please direct your questions about that compiler to the
vendor, Wind River.

If you can reproduce your MIPS alignment problem using gcc-4.3 or newer, then
that's something you should report here in a new bugzilla entry (so as to not
confuse this ARM problem with a possibly unrelated MIPS problem).


-- 


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


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

* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
  2008-10-29 19:43 [Bug c/37954] New: odd sized packed structures, " damon dot michaels at navico dot com
                   ` (2 preceding siblings ...)
  2009-10-21 12:20 ` mikpe at it dot uu dot se
@ 2009-10-21 14:47 ` maurice35 dot david at laposte dot net
  2009-10-21 19:47 ` mikpe at it dot uu dot se
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: maurice35 dot david at laposte dot net @ 2009-10-21 14:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from maurice35 dot david at laposte dot net  2009-10-21 14:46 -------
My version is:
[root@xxxx build]# ccmips -V
ccmips: `-V' option must have argument
[root@pace build]# ccmips --version
ccmips (GCC) 3.3.2 20030904 (Wind River vxworks61) (built 20050516)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


-- 

maurice35 dot david at laposte dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maurice35 dot david at
                   |                            |laposte dot net


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


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

* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
  2008-10-29 19:43 [Bug c/37954] New: odd sized packed structures, " damon dot michaels at navico dot com
  2009-10-21  9:36 ` [Bug target/37954] odd sized packed structures passed by value, " maurice35 dot david at laposte dot net
  2009-10-21  9:37 ` maurice35 dot david at laposte dot net
@ 2009-10-21 12:20 ` mikpe at it dot uu dot se
  2009-10-21 14:47 ` maurice35 dot david at laposte dot net
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: mikpe at it dot uu dot se @ 2009-10-21 12:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from mikpe at it dot uu dot se  2009-10-21 12:19 -------
I can reproduce the misalignment exceptions on armv5tel-linux-gnueabi with
gcc-4.3.4 at -O0 but not with gcc-4.4.2.  The loop in main() which iterates
over the packed array creates a misaligned pointer from which it performs
word-sized loads, which causes misalignment exceptions.  gcc-4.4.2 generates
very different code which doesn't make assumptions about alignment.


-- 

mikpe at it dot uu dot se changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu dot se


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


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

* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
  2008-10-29 19:43 [Bug c/37954] New: odd sized packed structures, " damon dot michaels at navico dot com
  2009-10-21  9:36 ` [Bug target/37954] odd sized packed structures passed by value, " maurice35 dot david at laposte dot net
@ 2009-10-21  9:37 ` maurice35 dot david at laposte dot net
  2009-10-21 12:20 ` mikpe at it dot uu dot se
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: maurice35 dot david at laposte dot net @ 2009-10-21  9:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from maurice35 dot david at laposte dot net  2009-10-21 09:37 -------
It seems that I have a similar issue with ccmips compilator :
typedef struct
{
char A;  
char B;
char C;
/*char padding;*/
} tStructABC;

typedef struct
{
tStructABC ABC1;  
tStructABC ABC2;  
} tStruct2ABC;

tStruct2ABC Struct2ABC;

int Compute(tStructABC ArgA,tStructABC ArgB)
{
                return(ArgA.A+ArgA.B);
}
int main(int argc, char *argv[])
{
tStructABC * pABC1;
tStructABC * pABC2;
                pABC1 = &(Struct2ABC.ABC1);
                pABC2 = &(Struct2ABC.ABC2);
                printf("Compute=%d\n",Compute(*pABC1,*pABC2));
}

This code crash with the printout:
Address load Exception
Exception Program Counter: 0x803f56f8
Status Register: 0x3000ff01
Cause Register: 0x00000010
Access Address : 0x80b8da83
Task: 0x80ffa440 "PGL_Main"
0x80ffa440 (PGL_Main): task 0x80ffa440 has had a failure and has been stopped.
0x80ffa440 (PGL_Main): fatal kernel task-level exception!

So The crash is due to an alignment issue on the address &(Struct2ABC.ABC2);.
To avoid this issue we need to add a padding byte in tStructABC because it
seems that there is no way to force a padding through a compilation option or
through a #pragma (as example  #pragma pack(4)).

Please could you confirm this issue in compilation sw (ccmips) or not.

see: Created an attachment (id=18854)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18854&action=view) [edit]
Screen shoot form lauterbach


Best regard,


-- 


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


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

* [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application
  2008-10-29 19:43 [Bug c/37954] New: odd sized packed structures, " damon dot michaels at navico dot com
@ 2009-10-21  9:36 ` maurice35 dot david at laposte dot net
  2009-10-21  9:37 ` maurice35 dot david at laposte dot net
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: maurice35 dot david at laposte dot net @ 2009-10-21  9:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from maurice35 dot david at laposte dot net  2009-10-21 09:36 -------
Created an attachment (id=18854)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18854&action=view)
Screen shoot form lauterbach


-- 


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


^ 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-37954-4@http.gcc.gnu.org/bugzilla/>
2011-04-28 16:25 ` [Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application rguenth at gcc dot gnu.org
2015-03-12 11:29 ` ramana at gcc dot gnu.org
2015-04-30 11:15 ` amodra at gmail dot com
2008-10-29 19:43 [Bug c/37954] New: odd sized packed structures, " damon dot michaels at navico dot com
2009-10-21  9:36 ` [Bug target/37954] odd sized packed structures passed by value, " maurice35 dot david at laposte dot net
2009-10-21  9:37 ` maurice35 dot david at laposte dot net
2009-10-21 12:20 ` mikpe at it dot uu dot se
2009-10-21 14:47 ` maurice35 dot david at laposte dot net
2009-10-21 19:47 ` mikpe at it dot uu dot se
2009-10-22 17:55 ` mikpe at it dot uu dot se
2009-10-23  0:29 ` mikpe at it dot uu dot se
2009-10-23 12:49 ` mikpe at it dot uu dot se

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