https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107304
--- Comment #16 from Hongtao.liu <crazylht at gmail dot com> --- (In reply to H.J. Lu from comment #15) > (In reply to Hongtao.liu from comment #14) > > (In reply to H.J. Lu from comment #12) > > > (In reply to Hongyu Wang from comment #10) > > > > > > > > Clang works properly as it overrides -march= to any target clones. I > > > > suppose > > > > we can do similar things in ix86_valid_target_attribute_p > > > > > > That will be wrong since target attribute can be used to disable vector > > > instructions. > > > > But target_clones can't? > > https://godbolt.org/z/jn6GMrdsb > > arch=nehalem will disable AVX. The question is should command line -mavx -march=nehalem disable avx? I think the currect implementation only set not clear isa bits. 2173#define DEF_PTA(NAME) \ 2174 if (((processor_alias_table[i].flags & PTA_ ## NAME) != 0) \ 2175 && PTA_ ## NAME != PTA_64BIT \ 2176 && (TARGET_64BIT || PTA_ ## NAME != PTA_UINTR) \ 2177 && !TARGET_EXPLICIT_ ## NAME ## _P (opts)) \ 2178 SET_TARGET_ ## NAME (opts); 2179#include "i386-isa.def" 2180#undef DEF_PTA