This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch for 930513-1 on Darwin
- To: Geoff Keating <geoffk at geoffk dot org>
- Subject: Re: patch for 930513-1 on Darwin
- From: Dale Johannesen <dalej at apple dot com>
- Date: Thu, 31 May 2001 17:32:19 -0700
- Cc: dalej at apple dot com, gcc-patches at gcc dot gnu dot org
On Thursday, May 31, 2001, at 05:03 PM, Geoff Keating wrote:
> dalej@apple.com writes:
>
>> Background:
>> We have a longstanding failure on test execute/930513-1.c with -O3 for
>> Darwin. What happens is that a function name is passed to a callee,
>> which expects a pointer-to-function, which is dereferenced and called.
>> When the callee is expanded inline, the nested call becomes a direct
>> call to the function name. On Darwin, the required syntax for a
>> function name is different when you call it and when you pass its
>> address, so the inliner needs to change things to compensate. I don't
>> see any hooks for this in integrate.c (perhaps by coincidence, no other
>> machine I know of has such a requirement) so I added a macro. There
>> will be no functional change on any other target.
>>
>> 2001-05-31 Dale Johannesen <dalej@apple.com>
>>
>> * integrate.c, config/rs6000/darwin.h: for Darwin, change
>> function name
>> syntax when function passed as parameter is called, due to
>> inlining. Macro
>> ADJUST_CALLEE_SYM_NAME added. Functional change on Darwin
>> only.
>
> Why can't this transformation be done in the call patterns of the MD
> file?
> I think that's how it's done for AIX.
Maybe. Could you be more specific? I looked at the AIX code, but it
looked like the problem didn't occur there. Presumably you would
generate a call_indirect_aix32 (or variant) originally, which matches
*call_indirect_nonlocal_aix32 later, but that only accepts a register as
op0. In the problem case this inliner has changed this to a symbol_ref,
and I don't see anything that matches that. Which led me to believe
that the inliner doesn't do this substitution in the AIX case, which is
plausible as the call_indirect_aix32 code is more complex. Of course
I'd like to look at what actually happens on AIX, but I don't have one.