public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/102148] New: ppc64le: homogeneous float arguments are not passed correctly
@ 2021-08-31 18:29 zlwang at ca dot ibm.com
  2021-09-01 15:13 ` [Bug target/102148] " dje at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zlwang at ca dot ibm.com @ 2021-08-31 18:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102148
           Summary: ppc64le: homogeneous float arguments are not passed
                    correctly
           Product: gcc
           Version: 8.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zlwang at ca dot ibm.com
  Target Milestone: ---

example program:

typedef struct {
        float a[2];
} sub;
typedef struct {float b; sub c; float d;} R;
extern R func(long,R,float,int);
R v = {0, {1,2}, 3};

double ma() {
        R rv = func(77,v,88,99);
        return rv.d;
}


Since R is a homogeneous float aggregate with less than 8 elements, func
argument passing should look like the following function:

func(long, float, float, float, float, float, int)

But they are not. At least for gcc8.4.1, the latter's long/int are passed in r3
and r9 respectively; while the former's long/int are passed in r3 and r7
respectively.

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

* [Bug target/102148] ppc64le: homogeneous float arguments are not passed correctly
  2021-08-31 18:29 [Bug c/102148] New: ppc64le: homogeneous float arguments are not passed correctly zlwang at ca dot ibm.com
@ 2021-09-01 15:13 ` dje at gcc dot gnu.org
  2021-09-01 20:00 ` zlwang at ca dot ibm.com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dje at gcc dot gnu.org @ 2021-09-01 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-09-01
             Target|powerpc64le                 |powerpc64le-*-linux
     Ever confirmed|0                           |1

--- Comment #1 from David Edelsohn <dje at gcc dot gnu.org> ---
Confirmed.

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

* [Bug target/102148] ppc64le: homogeneous float arguments are not passed correctly
  2021-08-31 18:29 [Bug c/102148] New: ppc64le: homogeneous float arguments are not passed correctly zlwang at ca dot ibm.com
  2021-09-01 15:13 ` [Bug target/102148] " dje at gcc dot gnu.org
@ 2021-09-01 20:00 ` zlwang at ca dot ibm.com
  2021-09-01 20:03 ` zlwang at ca dot ibm.com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: zlwang at ca dot ibm.com @ 2021-09-01 20:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from julian <zlwang at ca dot ibm.com> ---
ABI text will be clarified re this case.  The two cases are different after all
(register foot-print are the same, but the parameter saving-area will be
different). such that GPR skipping is different.

I am closing this.

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

* [Bug target/102148] ppc64le: homogeneous float arguments are not passed correctly
  2021-08-31 18:29 [Bug c/102148] New: ppc64le: homogeneous float arguments are not passed correctly zlwang at ca dot ibm.com
  2021-09-01 15:13 ` [Bug target/102148] " dje at gcc dot gnu.org
  2021-09-01 20:00 ` zlwang at ca dot ibm.com
@ 2021-09-01 20:03 ` zlwang at ca dot ibm.com
  2021-09-01 20:04 ` wschmidt at gcc dot gnu.org
  2021-09-01 20:18 ` wschmidt at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: zlwang at ca dot ibm.com @ 2021-09-01 20:03 UTC (permalink / raw)
  To: gcc-bugs

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

julian <zlwang at ca dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from julian <zlwang at ca dot ibm.com> ---
closing ...

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

* [Bug target/102148] ppc64le: homogeneous float arguments are not passed correctly
  2021-08-31 18:29 [Bug c/102148] New: ppc64le: homogeneous float arguments are not passed correctly zlwang at ca dot ibm.com
                   ` (2 preceding siblings ...)
  2021-09-01 20:03 ` zlwang at ca dot ibm.com
@ 2021-09-01 20:04 ` wschmidt at gcc dot gnu.org
  2021-09-01 20:18 ` wschmidt at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2021-09-01 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
Thanks, Julian.  I'll record this for the next ABI update.

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

* [Bug target/102148] ppc64le: homogeneous float arguments are not passed correctly
  2021-08-31 18:29 [Bug c/102148] New: ppc64le: homogeneous float arguments are not passed correctly zlwang at ca dot ibm.com
                   ` (3 preceding siblings ...)
  2021-09-01 20:04 ` wschmidt at gcc dot gnu.org
@ 2021-09-01 20:18 ` wschmidt at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2021-09-01 20:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
For anyone running into this problem and wondering about the resolution:

It is a matter of some confusion how homogeneous aggregates are mapped to the
parameter save area. This came up recently with
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102148. It would be helpful to add
some clarifying text for the following points.

(1) The parameter save area layout is completely independent from the rules for
passing homogeneous aggregates in registers.
(2) The size of a homogeneous aggregate parameter in the parameter save area is
the size of that aggregate by normal rules of alignment and padding. This means
that the parameter save area for a homogeneous aggregate of 32-bit floats takes
up less room than the amount of register space consumed.
(3) The number of GPRs skipped is based upon the size of the aggregate in the
parameter save area.

An example of this exists (Figure 2.26 in revision 1.5), but it is easy to have
difficulty spotting the information there.

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

end of thread, other threads:[~2021-09-01 20:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 18:29 [Bug c/102148] New: ppc64le: homogeneous float arguments are not passed correctly zlwang at ca dot ibm.com
2021-09-01 15:13 ` [Bug target/102148] " dje at gcc dot gnu.org
2021-09-01 20:00 ` zlwang at ca dot ibm.com
2021-09-01 20:03 ` zlwang at ca dot ibm.com
2021-09-01 20:04 ` wschmidt at gcc dot gnu.org
2021-09-01 20:18 ` wschmidt at gcc dot gnu.org

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