PATCH: PR target/39472: Add -mabi=[ms|sysv]
Kai Tietz
ktietz70@googlemail.com
Tue Mar 17 18:22:00 GMT 2009
Hallo H.J,
this patch looks fine to me, beside these three junks
> @@ -2740,7 +2757,7 @@ override_options (bool main_args_p)
> use of rip-relative addressing. This eliminates fixups that
> would otherwise be needed if this object is to be placed in a
> DLL, and is essentially just as efficient as direct addressing. */
> - if (TARGET_64BIT && DEFAULT_ABI == MS_ABI)
> + if (TARGET_64BIT && ix86_abi == MS_ABI)
> ix86_cmodel = CM_SMALL_PIC, flag_pic = 1;
> else if (TARGET_64BIT)
> ix86_cmodel = flag_pic ? CM_SMALL_PIC : CM_SMALL;
Do you want really to modify by this switch to pic mode and small
model for linux64?
> @@ -10096,7 +10115,7 @@ output_pic_addr_const (FILE *file, rtx x
> #endif
> assemble_name (file, name);
> }
> - if (!TARGET_MACHO && !(TARGET_64BIT && DEFAULT_ABI == MS_ABI)
> + if (!TARGET_MACHO && !(TARGET_64BIT && ix86_abi == MS_ABI)
> && code == 'P' && ! SYMBOL_REF_LOCAL_P (x))
> fputs ("@PLT", file);
> break;
This looks wrong to me, because for coff targets you never can emit @PLT.
> @@ -26683,7 +26702,7 @@ x86_function_profiler (FILE *file, int l
> fprintf (file, "\tleaq\t%sP%d@(%%rip),%%r11\n", LPREFIX, labelno);
> #endif
>
> - if (DEFAULT_ABI == SYSV_ABI && flag_pic)
> + if (ix86_abi == SYSV_ABI && flag_pic)
> fprintf (file, "\tcall\t*%s@GOTPCREL(%%rip)\n", MCOUNT_NAME);
> else
> fprintf (file, "\tcall\t%s\n", MCOUNT_NAME);
the same here, pep-coff do not have really a GOTPCREL.
By this I would check here DEFAULT_ABI, because it is the targets
default and can be used to decide if @PLT and @GOTPCREL are present.
Cheers,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
More information about the Gcc-patches
mailing list