https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89093

--- Comment #28 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Ramana Radhakrishnan from comment #27)
> (In reply to Bernd Edlinger from comment #25)
> > you might consider adding something like that to your patch:
> > 
> > Index: elf.h
> > ===================================================================
> > --- elf.h   (revision 268337)
> > +++ elf.h   (working copy)
> > @@ -64,7 +64,7 @@
> >  %{mapcs-*:-mapcs-%*} \
> >  %(subtarget_asm_float_spec) \
> >  %{mthumb-interwork:-mthumb-interwork} \
> > -%{mfloat-abi=*} %{!mfpu=auto: %{mfpu=*}} \
> > +%{mfloat-abi=*} %{!mfpu=auto: %{!mfpu=none: %{mfpu=*}}} \
> >  %(subtarget_extra_asm_spec)"
> >  #endif
> >  
> > 
> > 
> > otherwise using -mfpu=none won't work on the command line.
> > becuse gas does not understand it.
> 
> Yes, that's what I've been playing with. I've run out of time this week
> because of other work commitments, I hope to get back to this early next
> week.
> 
> Ramana

It is a bit unfortunate that -mfpu= on the command line seems to have
an impact on the eabi_attribute section, while the pragma does not:

          if (TARGET_HARD_FLOAT && TARGET_VFP_SINGLE)
            arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 1);

          if (TARGET_HARD_FLOAT_ABI)
            arm_emit_eabi_attribute ("Tag_ABI_VFP_args", 28, 1);

where TARGET_HARD_FLOAT and TARGET_VFP_SINGLE are defined as follows:

#define TARGET_HARD_FLOAT       (arm_float_abi != ARM_FLOAT_ABI_SOFT    \
                                 && bitmap_bit_p (arm_active_target.isa, \
                                                  isa_bit_vfpv2) \
                                 && TARGET_32BIT)

#define TARGET_VFP_DOUBLE (bitmap_bit_p (arm_active_target.isa,
isa_bit_fp_dbl))

#define TARGET_VFP_SINGLE (!TARGET_VFP_DOUBLE)


But arm_active_target.isa seems to depend on the effective -mfpu= command line
option, while later in the code generation the same macros are used to
select the use of VFP instructions.

I wonder if it would be better to have an orthogonal way to specify
the used ABI and the used register banks.

So like -mfpu=vfpv3-d16 and -mno-vfp,
where -mfpu= affects the eabi_attribute only
and -mno-vfp makes sure that no VFP registers are used, and, in particular
if functions are defined or called, where the ABI is incompatible because it
passes the values in VFP registers, that should be diagnosed, because it
will not work as expected.

Reply via email to