avoid transformations on __magic_inline functions

This commit is contained in:
Wolfgang Thaller 2012-04-15 03:34:33 +02:00
parent a79c598392
commit 390818e425
2 changed files with 30 additions and 1 deletions

View File

@ -181,7 +181,21 @@ prepare_call_address (tree fndecl, rtx funexp, rtx static_chain_value,
else if (! sibcallp)
{
#ifndef NO_FUNCTION_CSE
if (optimize && ! flag_no_function_cse)
int is_magic = 0;
tree decl = fndecl;//SYMBOL_REF_DECL(funexp);
if(decl)
{
if(DECL_NAME(decl))
{
if(!strncmp(IDENTIFIER_POINTER (DECL_NAME (decl)), "__magic_inline_", 15))
{
is_magic = 1;
}
}
fprintf(stderr, "CSE?: %s\n", IDENTIFIER_POINTER (DECL_NAME (decl)));
}
if (optimize && ! flag_no_function_cse && !is_magic)
funexp = force_reg (Pmode, funexp);
#endif
}

View File

@ -2437,6 +2437,21 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED,
/* First handle a simple SYMBOL_REF or LABEL_REF */
if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
{
if(GET_CODE (orig) == SYMBOL_REF)
{
tree decl = SYMBOL_REF_DECL(orig);
if(decl)
{
if(DECL_NAME(decl))
{
if(!strncmp(IDENTIFIER_POINTER (DECL_NAME (decl)), "__magic_inline_", 15))
{
return orig;
}
}
//fprintf(stderr, "Hello: %s\n", IDENTIFIER_POINTER (DECL_NAME (decl)));
}
}
gcc_assert (reg);
pic_ref = m68k_wrap_symbol_into_got_ref (orig, RELOC_GOT, reg);