[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

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


[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

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


[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

2011-04-28 Thread rguenth at gcc dot gnu.org
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   |---


[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

2009-10-23 Thread mikpe at it dot uu dot se


--- 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=18879action=view)
backport of r141742 to gcc-4.3.4 that I'm testing


-- 


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



[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

2009-10-22 Thread mikpe at it dot uu dot se


--- 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=18869action=view)
reduced test case in plain C


-- 


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



[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

2009-10-22 Thread mikpe at it dot uu dot se


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



[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

2009-10-21 Thread maurice35 dot david at laposte dot net


--- 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=18854action=view)
Screen shoot form lauterbach


-- 


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



[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

2009-10-21 Thread maurice35 dot david at laposte dot net


--- 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: 0x0010
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=18854action=view) [edit]
Screen shoot form lauterbach


Best regard,


-- 


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



[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

2009-10-21 Thread mikpe at it dot uu dot se


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



[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

2009-10-21 Thread maurice35 dot david at laposte dot net


--- Comment #9 from maurice35 dot david at laposte dot net  2009-10-21 
14:46 ---
My version is:
[r...@ build]# ccmips -V
ccmips: `-V' option must have argument
[r...@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



[Bug target/37954] odd sized packed structures passed by value, under ARM, cause lockup of application

2009-10-21 Thread mikpe at it dot uu dot se


--- Comment #10 from mikpe at it dot uu dot se  2009-10-21 19:47 ---
(In reply to comment #9)
 My version is:
 [r...@ build]# ccmips -V
 ccmips: `-V' option must have argument
 [r...@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