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