This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH 3.3 0203 i386/{i386.c,{i386elf,ptx4-i,sysv4}.h} forUnixWare build failure.
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Rodney D Brown <rbrown64 at csc dot com dot au>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 05 Feb 2003 08:04:16 -0800
- Subject: Re: PATCH 3.3 0203 i386/{i386.c,{i386elf,ptx4-i,sysv4}.h} forUnixWare build failure.
- References: <OF602979B1.0E5F44E9-ONCA256CC4.0002A688@de-wil.csc.com><87vfzzqzqs.fsf@egil.codesourcery.com><20030205100321.GC14578@kam.mff.cuni.cz>
Jan Hubicka <jh@suse.cz> writes:
>> "Rodney D Brown" <rbrown64@csc.com.au> writes:
>>
>> > I believe the patch is needed from this change. Jan seems to be
>> > moving to using DEFAULT_PCC_STRUCT_RETURN over RETURN_IN_MEMORY.
>>
>> This is not good. As I said, DEFAULT_PCC_STRUCT_RETURN is obsolete,
>> we need to be moving *away* from it.
>
> Agreed.
> There is still problem in this code, even after changing i386 setting of
> flag_pcc_struct_return to DEFAULT_PCC_STRUCT_RETURN? I think when
> target overwrite RETURN_IN_MEMORY and DEFAULT_PCC_STRUCT_RETURN, it
> should be safe...
I thought I explained the problem in the next two paragraphs. What
was unclear?
>> DEFAULT_PCC_STRUCT_RETURN sets the default value of
>> flag_pcc_struct_return. If flag_pcc_struct_return is on, it
>> overrides the target's ABI (as defined by RETURN_IN_MEMORY) and forces
>> all types for which AGGREGATE_TYPE_P is true to be returned in
>> memory. The default for DEFAULT_PCC_STRUCT_RETURN happens to be 1,
>> which means any target with a nontrivial RETURN_IN_MEMORY (such as the
>> x86) *must* set DEFAULT_PCC_STRUCT_RETURN to 0 unconditionally for GCC
>> to get the ABI right.
>>
>> Now, the definition of x86_return_in_memory is such that I doubt
>> anyone has noticed this, but it's still a problem. I am 99+% sure
>> that if we went through config/i386, removed all of the definitions of
>> RETURN_IN_MEMORY except the ones in i386.h, replaced all the existing
>> definitions of DEFAULT_PCC_STRUCT_RETURN with just one in i386.h
>> (defining it to 0), and ripped out the code in override_options that
>> mucks with flag_pcc_struct_return, there would be *no* changes to the
>> ABI on any i386 subtarget. And if I'm wrong, the changes would
>> probably correct corner cases of the ABI.
zw