This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH 3.3 0203 i386/{i386.c,{i386elf,ptx4-i,sysv4}.h} forUnixWare build failure.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]