https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107364
Bug ID: 107364 Summary: ICE on Via Nehemiah with --march=native Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: orzel at freehackers dot org Target Milestone: --- The cpu is very old: chopin /etc # cat /proc/cpuinfo processor : 0 vendor_id : CentaurHauls cpu family : 6 model : 9 model name : VIA Nehemiah stepping : 3 cpu MHz : 997.000 cache size : 64 KB fdiv_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu de pse tsc msr cx8 mtrr pge cmov mmx fxsr sse cpuid rng rng_en bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown bogomips : 1999.03 clflush size : 32 cache_alignment : 32 address sizes : 32 bits physical, 32 bits virtual power management: The compiler crashes when using -march=native. You dont need to compile for it to crash, --help=target is enough. As a result, gcc can't build itself anymore. The last known 'working' version is gcc 9. Tested are gcc 10, 11, and 12, all crashing the same way. This is how it looks: chopin /etc # gcc-12 -Q --help=target -march=native -freport-bug gcc-12: internal compiler error: in cpu_indicator_init, at common/config/i386/cpuinfo.h:986 0xb7cd535e __libc_start_main ???:0 Please submit a full bug report, with preprocessed source. Please include the complete backtrace with any bug report. See <https://bugs.gentoo.org/> for instructions. chopin /etc # gcc-12 -Q --help=target The following options are target specific: -m128bit-long-double [disabled] -m16 [disabled] -m32 [enabled] -m3dnow [disabled] -m3dnowa [disabled] -m64 [disabled] -m80387 [enabled] -m8bit-idiv [disabled] -m96bit-long-double [enabled] -mabi= sysv -mabm [disabled] -maccumulate-outgoing-args [disabled] -maddress-mode= short -madx [disabled] -maes [disabled] -malign-data= compat -malign-double [disabled] -malign-functions= 0 -malign-jumps= 0 -malign-loops= 0 -malign-stringops [enabled] -mamx-bf16 [disabled] -mamx-int8 [disabled] -mamx-tile [disabled] -mandroid [disabled] -march= i686 -masm= att -mavx [disabled] -mavx2 [disabled] -mavx256-split-unaligned-load [disabled] -mavx256-split-unaligned-store [disabled] -mavx5124fmaps [disabled] -mavx5124vnniw [disabled] -mavx512bf16 [disabled] -mavx512bitalg [disabled] -mavx512bw [disabled] -mavx512cd [disabled] -mavx512dq [disabled] -mavx512er [disabled] -mavx512f [disabled] -mavx512fp16 [disabled] -mavx512ifma [disabled] -mavx512pf [disabled] -mavx512vbmi [disabled] -mavx512vbmi2 [disabled] -mavx512vl [disabled] -mavx512vnni [disabled] -mavx512vp2intersect [disabled] -mavx512vpopcntdq [disabled] -mavxvnni [disabled] -mbionic [disabled] -mbmi [disabled] -mbmi2 [disabled] -mbranch-cost=<0,5> 3 -mcall-ms2sysv-xlogues [disabled] -mcet-switch [disabled] -mcld [disabled] -mcldemote [disabled] -mclflushopt [disabled] -mclwb [disabled] -mclzero [disabled] -mcmodel= 32 -mcpu= -mcrc32 [disabled] -mcx16 [disabled] -mdirect-extern-access [enabled] -mdispatch-scheduler [disabled] -mdump-tune-features [disabled] -menqcmd [disabled] -mf16c [disabled] -mfancy-math-387 [enabled] -mfentry [disabled] -mfentry-name= -mfentry-section= -mfma [disabled] -mfma4 [disabled] -mforce-drap [disabled] -mforce-indirect-call [disabled] -mfp-ret-in-387 [enabled] -mfpmath= 387 -mfsgsbase [disabled] -mfunction-return= keep -mfused-madd -ffp-contract=fast -mfxsr [disabled] -mgeneral-regs-only [disabled] -mgfni [disabled] -mglibc [enabled] -mhard-float [enabled] -mharden-sls= none -mhle [disabled] -mhreset [disabled] -miamcu [disabled] -mieee-fp [enabled] -mincoming-stack-boundary= 0 -mindirect-branch-cs-prefix [disabled] -mindirect-branch-register [disabled] -mindirect-branch= keep -minline-all-stringops [disabled] -minline-stringops-dynamically [disabled] -minstrument-return= none -mintel-syntax -masm=intel -mkl [disabled] -mlarge-data-threshold=<number> 65536 -mlong-double-128 [disabled] -mlong-double-64 [disabled] -mlong-double-80 [enabled] -mlwp [disabled] -mlzcnt [disabled] -mmanual-endbr [disabled] -mmemcpy-strategy= -mmemset-strategy= -mmitigate-rop [disabled] -mmmx [disabled] -mmovbe [disabled] -mmovdir64b [disabled] -mmovdiri [disabled] -mmove-max= 128 -mmpx [disabled] -mms-bitfields [disabled] -mmusl [disabled] -mmwait [disabled] -mmwaitx [disabled] -mneeded [disabled] -mno-align-stringops [disabled] -mno-default [disabled] -mno-fancy-math-387 [disabled] -mno-push-args [disabled] -mno-red-zone [enabled] -mno-sse4 [enabled] -mnop-mcount [disabled] -momit-leaf-frame-pointer [disabled] -mpc32 [disabled] -mpc64 [disabled] -mpc80 [disabled] -mpclmul [disabled] -mpcommit [disabled] -mpconfig [disabled] -mpku [disabled] -mpopcnt [disabled] -mprefer-avx128 -mprefer-vector-width=128 -mprefer-vector-width= none -mpreferred-stack-boundary= 0 -mprefetchwt1 [disabled] -mprfchw [disabled] -mptwrite [disabled] -mpush-args [enabled] -mrdpid [disabled] -mrdrnd [disabled] -mrdseed [disabled] -mrecip [disabled] -mrecip= -mrecord-mcount [disabled] -mrecord-return [disabled] -mred-zone [disabled] -mregparm= 0 -mrelax-cmpxchg-loop [disabled] -mrtd [disabled] -mrtm [disabled] -msahf [enabled] -mserialize [disabled] -msgx [disabled] -msha [disabled] -mshstk [disabled] -mskip-rax-setup [disabled] -msoft-float [disabled] -msse [disabled] -msse2 [disabled] -msse2avx [disabled] -msse3 [disabled] -msse4 [disabled] -msse4.1 [disabled] -msse4.2 [disabled] -msse4a [disabled] -msse5 -mavx -msseregparm [disabled] -mssse3 [disabled] -mstack-arg-probe [disabled] -mstack-protector-guard-offset= -mstack-protector-guard-reg= -mstack-protector-guard-symbol= -mstack-protector-guard= tls -mstackrealign [disabled] -mstore-max= 128 -mstringop-strategy= [default] -mstv [enabled] -mtbm [disabled] -mtls-dialect= gnu -mtls-direct-seg-refs [enabled] -mtsxldtrk [disabled] -mtune-ctrl= -mtune= generic -muclibc [disabled] -muintr [disabled] -mvaes [disabled] -mveclibabi= [default] -mvect8-ret-in-mem [disabled] -mvpclmulqdq [disabled] -mvzeroupper [enabled] -mwaitpkg [disabled] -mwbnoinvd [disabled] -mwidekl [disabled] -mx32 [disabled] -mxop [disabled] -mxsave [disabled] -mxsavec [disabled] -mxsaveopt [disabled] -mxsaves [disabled] Known assembler dialects (for use with the -masm= option): att intel Known ABIs (for use with the -mabi= option): ms sysv Known code models (for use with the -mcmodel= option): 32 kernel large medium small Valid arguments to -mfpmath=: 387 387+sse 387,sse both sse sse+387 sse,387 Known choices for mitigation against straight line speculation with -mharden-sls=: all indirect-jmp none return Known indirect branch choices (for use with the -mindirect-branch=/-mfunction-return= options): keep thunk thunk-extern thunk-inline Known choices for return instrumentation with -minstrument-return=: call none nop5 Known data alignment choices (for use with the -malign-data= option): abi cacheline compat Known vectorization library ABIs (for use with the -mveclibabi= option): acml svml Known address mode (for use with the -maddress-mode= option): long short Known preferred register vector length (to use with the -mprefer-vector-width= option): 128 256 512 none Known stack protector guard (for use with the -mstack-protector-guard= option): global tls Valid arguments to -mstringop-strategy=: byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop vector_loop Known TLS dialects (for use with the -mtls-dialect= option): gnu gnu2 Known valid arguments for -march= option: i386 i486 i586 pentium lakemont pentium-mmx winchip-c6 winchip2 c3 samuel-2 c3-2 nehemiah c7 esther i686 pentiumpro pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm intel geode k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 generic native Known valid arguments for -mtune= option: generic i386 i486 pentium lakemont pentiumpro pentium4 nocona core2 nehalem sandybridge haswell bonnell silvermont goldmont goldmont-plus tremont knl knm skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake rocketlake intel geode k6 athlon k8 amdfam10 bdver1 bdver2 bdver3 bdver4 btver1 btver2 znver1 znver2 znver3 chopin /etc # gcc-9.3.0 -Q --help=target -march=native The following options are target specific: (... everything ok here) A diff between gcc-9.3.0 -Q --help=target -march=native and gcc-12 -Q --help=target is: chopin /tmp # diff -u gcc9.target gcc12.target --- gcc9.target 2022-10-23 12:42:17.942193436 +0200 +++ gcc12.target 2022-10-23 12:42:24.598109760 +0200 @@ -20,28 +20,35 @@ -malign-jumps= 0 -malign-loops= 0 -malign-stringops [enabled] + -mamx-bf16 [disabled] + -mamx-int8 [disabled] + -mamx-tile [disabled] -mandroid [disabled] - -march= nehemiah + -march= i686 -masm= att -mavx [disabled] -mavx2 [disabled] - -mavx256-split-unaligned-load [enabled] - -mavx256-split-unaligned-store [enabled] + -mavx256-split-unaligned-load [disabled] + -mavx256-split-unaligned-store [disabled] -mavx5124fmaps [disabled] -mavx5124vnniw [disabled] + -mavx512bf16 [disabled] -mavx512bitalg [disabled] -mavx512bw [disabled] -mavx512cd [disabled] -mavx512dq [disabled] -mavx512er [disabled] -mavx512f [disabled] + -mavx512fp16 [disabled] -mavx512ifma [disabled] -mavx512pf [disabled] -mavx512vbmi [disabled] -mavx512vbmi2 [disabled] -mavx512vl [disabled] -mavx512vnni [disabled] + -mavx512vp2intersect [disabled] -mavx512vpopcntdq [disabled] + -mavxvnni [disabled] -mbionic [disabled] -mbmi [disabled] -mbmi2 [disabled] @@ -57,8 +64,10 @@ -mcpu= -mcrc32 [disabled] -mcx16 [disabled] + -mdirect-extern-access [enabled] -mdispatch-scheduler [disabled] -mdump-tune-features [disabled] + -menqcmd [disabled] -mf16c [disabled] -mfancy-math-387 [enabled] -mfentry [disabled] @@ -72,22 +81,26 @@ -mfpmath= 387 -mfsgsbase [disabled] -mfunction-return= keep - -mfused-madd - -mfxsr [enabled] + -mfused-madd -ffp-contract=fast + -mfxsr [disabled] -mgeneral-regs-only [disabled] -mgfni [disabled] -mglibc [enabled] -mhard-float [enabled] + -mharden-sls= none -mhle [disabled] + -mhreset [disabled] -miamcu [disabled] -mieee-fp [enabled] -mincoming-stack-boundary= 0 + -mindirect-branch-cs-prefix [disabled] -mindirect-branch-register [disabled] -mindirect-branch= keep -minline-all-stringops [disabled] -minline-stringops-dynamically [disabled] -minstrument-return= none - -mintel-syntax + -mintel-syntax -masm=intel + -mkl [disabled] -mlarge-data-threshold=<number> 65536 -mlong-double-128 [disabled] -mlong-double-64 [disabled] @@ -98,14 +111,17 @@ -mmemcpy-strategy= -mmemset-strategy= -mmitigate-rop [disabled] - -mmmx [enabled] + -mmmx [disabled] -mmovbe [disabled] -mmovdir64b [disabled] -mmovdiri [disabled] + -mmove-max= 128 -mmpx [disabled] -mms-bitfields [disabled] -mmusl [disabled] + -mmwait [disabled] -mmwaitx [disabled] + -mneeded [disabled] -mno-align-stringops [disabled] -mno-default [disabled] -mno-fancy-math-387 [disabled] @@ -122,7 +138,7 @@ -mpconfig [disabled] -mpku [disabled] -mpopcnt [disabled] - -mprefer-avx128 + -mprefer-avx128 -mprefer-vector-width=128 -mprefer-vector-width= none -mpreferred-stack-boundary= 0 -mprefetchwt1 [disabled] @@ -138,15 +154,17 @@ -mrecord-return [disabled] -mred-zone [disabled] -mregparm= 0 + -mrelax-cmpxchg-loop [disabled] -mrtd [disabled] -mrtm [disabled] - -msahf [disabled] + -msahf [enabled] + -mserialize [disabled] -msgx [disabled] -msha [disabled] -mshstk [disabled] -mskip-rax-setup [disabled] -msoft-float [disabled] - -msse [enabled] + -msse [disabled] -msse2 [disabled] -msse2avx [disabled] -msse3 [disabled] @@ -154,7 +172,7 @@ -msse4.1 [disabled] -msse4.2 [disabled] -msse4a [disabled] - -msse5 + -msse5 -mavx -msseregparm [disabled] -mssse3 [disabled] -mstack-arg-probe [disabled] @@ -163,14 +181,17 @@ -mstack-protector-guard-symbol= -mstack-protector-guard= tls -mstackrealign [disabled] + -mstore-max= 128 -mstringop-strategy= [default] -mstv [enabled] -mtbm [disabled] -mtls-dialect= gnu -mtls-direct-seg-refs [enabled] + -mtsxldtrk [disabled] -mtune-ctrl= -mtune= generic -muclibc [disabled] + -muintr [disabled] -mvaes [disabled] -mveclibabi= [default] -mvect8-ret-in-mem [disabled] @@ -178,6 +199,7 @@ -mvzeroupper [enabled] -mwaitpkg [disabled] -mwbnoinvd [disabled] + -mwidekl [disabled] -mx32 [disabled] -mxop [disabled] -mxsave [disabled] @@ -197,6 +219,9 @@ Valid arguments to -mfpmath=: 387 387+sse 387,sse both sse sse+387 sse,387 + Known choices for mitigation against straight line speculation with -mharden-sls=: + all indirect-jmp none return + Known indirect branch choices (for use with the -mindirect-branch=/-mfunction-return= options): keep thunk thunk-extern thunk-inline @@ -225,8 +250,8 @@ gnu gnu2 Known valid arguments for -march= option: - i386 i486 i586 pentium lakemont pentium-mmx winchip-c6 winchip2 c3 samuel-2 c3-2 nehemiah c7 esther i686 pentiumpro pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm intel geode k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 generic native + i386 i486 i586 pentium lakemont pentium-mmx winchip-c6 winchip2 c3 samuel-2 c3-2 nehemiah c7 esther i686 pentiumpro pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm intel geode k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 generic native Known valid arguments for -mtune= option: - generic i386 i486 pentium lakemont pentiumpro pentium4 nocona core2 nehalem sandybridge haswell bonnell silvermont goldmont goldmont-plus tremont knl knm skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake intel geode k6 athlon k8 amdfam10 bdver1 bdver2 bdver3 bdver4 btver1 btver2 znver1 znver2 + generic i386 i486 pentium lakemont pentiumpro pentium4 nocona core2 nehalem sandybridge haswell bonnell silvermont goldmont goldmont-plus tremont knl knm skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake rocketlake intel geode k6 athlon k8 amdfam10 bdver1 bdver2 bdver3 bdver4 btver1 btver2 znver1 znver2 znver3 This is a gentoo distribution. There's an option to compile GCC without any gentoo-specific patches. The compiler crashes also in this case (that is, when using the 'stage1' xgcc compiler to build the, i guess, stage2?). That's why we think the bug was worth reporting upstream.