On Sat, 2021-11-27 at 16:27 +0800, chenglulu wrote:
> +void
> +loongarch_config_target (struct loongarch_target *target,
> +                        HOST_WIDE_INT opt_switches,
> +                        int opt_arch, int opt_tune, int opt_fpu,
> +                        int opt_abi_base, int opt_abi_ext,
> +                        int opt_cmodel, int follow_multilib_list)

/* snip */

> +
> +      if (isa_fpu_compat_p (&(t.isa), &(force_isa)));
> +       /* keep quiet */
> +      else if (constrained.abi_base && (t.abi.base !=
> force_abi.base))
> +       inform (UNKNOWN_LOCATION,
> +               "%<-m%s%> overrides %<-m" OPTSTR_ABI_BASE "=%s%>",
> +               loongarch_switch_strings[on_switch],
> +               loongarch_abi_base_strings[t.abi.base]);

bootstrap with --enable-werror-always fails:

> In function ‘int isa_fpu_compat_p(const loongarch_isa*, const 
> loongarch_isa*)’,
> inlined from ‘void loongarch_config_target(loongarch_target*, long int, int, 
> int, int, int, int, int, int)’ at 
> ../../gcc/config/loongarch/loongarch-opts.c:194:28:
> ../../gcc/config/loongarch/loongarch-opts.c:436:24: error: 
> ‘t.loongarch_target::isa.loongarch_isa::fpu’ may be used uninitialized 
> [-Werror=maybe-uninitialized  ]
>   436 |         return set1 -> fpu == ISA_EXT_FPU32 || set1 -> fpu == 
> ISA_EXT_FPU64;
>       |                ~~~~~~~~^~~
> ../../gcc/config/loongarch/loongarch-opts.c: In function ‘void 
> loongarch_config_target(loongarch_target*, long int, int, int, int, int, int, 
> int, int)’:
> ../../gcc/config/loongarch/loongarch-opts.c:136:27: note: ‘t’ declared here
>   136 |   struct loongarch_target t;
>       |                           ^
> cc1plus: all warnings being treated as errors

And I can tell it's not a false warning: t.isa is really not initialized
here.
-- 
Xi Ruoyao <xry...@mengyan1223.wang>
School of Aerospace Science and Technology, Xidian University

Reply via email to