Stream: t-compiler

Topic: PowerPC C ABI fixes PR #64259


nagisa (Nov 07 2019 at 16:00, on Zulip):

I feel that this PR has a couple of contention points

gnzlbg (Nov 07 2019 at 16:00, on Zulip):

The status of PPC32 is that is a target that nobody uses

gnzlbg (Nov 07 2019 at 16:00, on Zulip):

nobody is responsible for its ABI

gnzlbg (Nov 07 2019 at 16:00, on Zulip):

better not touch it and break things

pnkfelix (Nov 07 2019 at 16:01, on Zulip):

so what is PR author's motivation then?

eddyb (Nov 07 2019 at 16:01, on Zulip):

oh you mean on GCC's side?

nagisa (Nov 07 2019 at 16:01, on Zulip):
  1. There is a generalization to no longer check for -gnu abi when applying this hack etc.
gnzlbg (Nov 07 2019 at 16:01, on Zulip):

for ZSTs, the ABI spec of PPC32 is "weird", but that's how it is

pnkfelix (Nov 07 2019 at 16:01, on Zulip):

hmm

pnkfelix (Nov 07 2019 at 16:01, on Zulip):

actually

pnkfelix (Nov 07 2019 at 16:01, on Zulip):

we are now over time

pnkfelix (Nov 07 2019 at 16:01, on Zulip):

so lets move this discussion into a dedicated separate topic

eddyb (Nov 07 2019 at 16:02, on Zulip):

one thing I wanted to suggest during the discussion on the PR was that we "just" drop ZST support in FFI and warn about it - but @Josh Triplett pointed out to me that it can arise from C code with #ifdefs around struct fields

gnzlbg (Nov 07 2019 at 16:02, on Zulip):

For the 32-bit ELF ABI, all structs (regardless of size) are passed using a pointer allowing for call-by-value semantics. This is the source of ZSTs requiring a register. So it's clear there is an ABI that requires this behavior. (Look for the Parameter Passing Register Selection Algorithm in https://github.com/ryanarn/powerabi/blob/master/chap3-elf32abi.sgml.)

nikomatsakis (Nov 07 2019 at 16:02, on Zulip):

(My only real thought here is that we should just decide something, and I lean towards more conservative choices for now, e.g. extending a list of special cases, perhaps with a comment that says "we might consider genearlizing this to a rule like such-and-such" so that we notice it in the future as we add more)

nagisa (Nov 07 2019 at 16:03, on Zulip):

I don’t have time to contribute to this discussion, gotta go walk my quadruped friend, but my broad desire to land something here stays. I don’t see much harm in generalizing over gnu&musl.

eddyb (Nov 07 2019 at 16:05, on Zulip):

I might be fine with an approach where we derive the "ZSTs aren't passed" behavior without having to up-front force it, but it may be tricky to ensure that it "fall out" of the general logic for all targets (and testing here is annoying, I'd prefer formal proofs at this point...)

nagisa (Nov 07 2019 at 16:05, on Zulip):

the check for that might need to happen, especially for the sparc branch, which is the only one which has actual ABIs that aren’t "GNU".

Last update: Nov 16 2019 at 02:30UTC