This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
target/8515: incomming altivec vectors on the stack unaligned to 16
- From: pinskia at physics dot uc dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Cc: hartwood at crosslink dot net
- Date: 10 Nov 2002 06:41:56 -0000
- Subject: target/8515: incomming altivec vectors on the stack unaligned to 16
- Reply-to: pinskia at physics dot uc dot edu
>Number: 8515
>Category: target
>Synopsis: incomming altivec vectors on the stack unaligned to 16
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Nov 09 22:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Andrew Pinski
>Release: gcc version 3.3 20021108 (experimental)
>Organization:
>Environment:
powerpc-apple-darwin6.1
>Description:
gcc stores incomming altivec vector arguments on the stack unaligned to 16 but to an 8 byte alignment which is wrong because stvx and lvx do not care about the lower 8 bits of the address so it could corrupted the stack.
>How-To-Repeat:
Run the following program and see that three out of the four addresses are not 16 byte aligned.
Compiled with -maltivec -include altivec.h -Wa,-force_cpusubtype_ALL.
void PrintShortVector (vector signed short v );
void PrintShortVector1 (vector signed short v );
void main()
{
PrintShortVector((vector signed short){1,2,3,4,5,6,7,8});
PrintShortVector1((vector signed short){1,2,3,4,5,6,7,8});
}
void PrintShortVector (vector signed short v )
{
signed short *vec = (signed short*)&v;
printf ("(%p) (%p) %hd %hd %hd %hd %hd %hd %hd %hd ",
vec, &v, vec[0], vec[1], vec[2], vec[3], vec[4], vec[5], vec[6], vec[7]);
}
typedef union {
vector signed short v ;
signed short vs[8] ;
} vv ;
void PrintShortVector1 (vector signed short v)
{
vv vv;
vv.v = v;
printf ("(%p) (%p) %hd %hd %hd %hd %hd %hd %hd %hd ", &vv, &v, vv.vs[0], vv.vs[1], vv.vs[2], vv.vs[3], vv.vs[4], vv.vs[5], vv.vs[6], vv.vs[7]);
}
According to hartwood@crosslink.net, it happens also on a VxWorks cross-compiler.
>Fix:
do not know
>Release-Note:
>Audit-Trail:
>Unformatted: