public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/10408: Two powerpc64 ABI incompatibilities in passing structures by value
@ 2003-04-15  0:56 amodra
  0 siblings, 0 replies; only message in thread
From: amodra @ 2003-04-15  0:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10408
>Category:       target
>Synopsis:       Two powerpc64 ABI incompatibilities in passing structures by value
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 15 00:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Alan Modra
>Release:        All current 3.x gcc branches
>Organization:
>Environment:

>Description:
The testcase below shows a couple of bugs in the way gcc
handles passing structures by value.  The powerpc64 ABI
states that
"The first eight doublewords mapped to the parameter save
 area are never stored in the parameter save area by the
 calling function.  Instead, these doublewords are passed
 in registers..."

Bug1: The testcase shows gcc passing the structure on the
stack in the -mstrict-align case.  This also happens for
structures of sizes 3,5,6,7 bytes without -mstrict-align.

Bug2: -mstrict-align affects argument padding.  With
-mstrict-align, the arg is padded upward in its slot,
without, the arg is padded downward.  Thus objects compiled
with -mstrict-align are incompatible with objects compiler
with -mno-strict-align.

>How-To-Repeat:
cat >m.c <<EOF
struct it { char c[2]; };
int foo (struct it x) { return x.c[0]; }
EOF
powerpc64-linux-gcc -O2 -S -mno-strict-align -o z1.s m.c
powerpc64-linux-gcc -O2 -S -mstrict-align -o z2.s m.c

-mno-strict-align
.foo:
        rldicl 3,3,56,56
        blr

-mstrict-align
.foo:
        lbz 3,48(1)
        blr
>Fix:
In progress.
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-15  0:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-15  0:56 target/10408: Two powerpc64 ABI incompatibilities in passing structures by value amodra

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