This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] use symbol_ref flags for rs6000
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>, Janis Johnson <janis187 at us dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 01 May 2003 17:54:11 -0400
- Subject: Re: [RFC] use symbol_ref flags for rs6000
>>>>> Richard Henderson writes:
Richard> One problem with this:
Richard> User code of the form
Richard> static int thunk[5];
Richard> ((void (*)(void))thunk) ();
Richard> that generates a call to the data section. If the linker
Richard> will handle this, fine, otherwise you need to return false
Richard> so that the address gets loaded into a register.
This is similar to an example in ffitest.c, where one needs to
hide the data object from the compiler. The above example fails, but
static int thunk[5];
int * pthunk = thunk;
asm ("" : "=g" (pthunk) : "0" (pthunk));
((void (*)(void))pthunk) ();
succeeds.
current_file_function_operand() is not the only predicate that
generates a direct PowerPC call, symbol_ref_operand() does as well. It
sounds like both current_file_function_operand() and symbol_ref_operand()
should test SYMBOL_REF_FUNCTION_P. It either needs to be in both
predicates or neither for the original example to succeed.
David