http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60233

--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Jakub Jelinek from comment #4)
> I think the reason for this is that -march=native passes in your case
> -mf16c, and -mf16c implies -mavx.  So, either OPTION_MASK_ISA_F16C_SET
> should not include OPTION_MASK_ISA_AVX_SET, or the driver shouldn't set
> -mf16c if AVX support is missing.
> As at least some of the F16C instructions use ymmN registers, if we'd change
> OPTION_MASK_ISA_F16C_SET, then the *256 TARGET_F16C patterns would also need
> to be guarded with && TARGET_AVX.
> For the latter alternative, we would need to do something like:
> --- gcc/config/i386/driver-i386.c 2014-01-03 11:41:06.393269411 +0100
> +++ gcc/config/i386/driver-i386.c 2014-02-17 07:32:41.289022308 +0100
> @@ -513,6 +513,7 @@ const char *host_detect_local_cpu (int a
>        has_avx2 = 0;
>        has_fma = 0;
>        has_fma4 = 0;
> +      has_f16c = 0;
>        has_xop = 0;
>        has_xsave = 0;
>        has_xsaveopt = 0;

This is the correct approach. We already disable f16c for -mno-avx in
common/config/i386/i386-common.c in this way, and it looks that driver-i386.c
was not updated accordingly.

There are no real processors with F16C and no AVX, but we should be consistent
here and follow i386-common.c.

Reply via email to