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

--- Comment #4 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to Christophe Lyon from comment #3)
> I tried changing TARGET_HARD_FLOAT_SUB in arm.h to:
> #define TARGET_HARD_FLOAT_SUB   (arm_float_abi != ARM_FLOAT_ABI_SOFT    \
>                                  && (bitmap_bit_p (arm_active_target.isa, \
>                                                   isa_bit_vfpv2) \
>                                     || bitmap_bit_p (arm_active_target.isa, \
>                                                      isa_bit_mve))      \
>                                  && TARGET_32BIT)
> 
> but that has other implications, like enabing VFP patterns: for instance
> mulsf3_vfp becomes enabled, leading to a failure when builing libgcc
> (vmul.f32 is generated for powisf2, but rejected by the assembler)
> 
> So maybe we just change the condition to emit the attributes in
> arm_file_start?
> 
> Something like:
>       if (! TARGET_SOFT_FLOAT || TARGET_HAVE_MVE)
>         {
>           if ((TARGET_HARD_FLOAT && TARGET_VFP_SINGLE) || TARGET_HAVE_MVE)
>             arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 1);
> 
>           if (TARGET_HARD_FLOAT_ABI || TARGET_HAVE_MVE)
>             arm_emit_eabi_attribute ("Tag_ABI_VFP_args", 28, 1);
>         }
> 

It doesn't look right, either.  Why would you want to set Tag_ABI_HardFP_use to
1 when there's no single-precision only FPU present?


Untested, but I think something like

      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);

is probably the right solution, removing the ! TARGET_SOFT_FLOAT entirely.

Reply via email to