This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR target/39472: Add -mabi=[ms|sysv]
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: "H.J. Lu" <hongjiu dot lu at intel dot com>
- Cc: gcc-patches at gcc dot gnu dot org, ubizjak at gmail dot com, jh at suse dot cz
- Date: Tue, 17 Mar 2009 19:20:16 +0100
- Subject: Re: PATCH: PR target/39472: Add -mabi=[ms|sysv]
- References: <20090317173220.GA27985@lucon.org>
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