https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95753
Bug ID: 95753 Summary: ICE when building the Linux Kernel for ARM64 (internal compiler error: ‘global_options’ are modified in local context) Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: luis.machado at linaro dot org Target Milestone: --- Created attachment 48753 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48753&action=edit preprocessed reproduction file While attempting to build a branch of the Linux Kernel for arm64 (repo is git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux, branch mte-v4) with a master GCC, I ran into the following ICE: ----------- /kernel/bpf/core.c:1368:1: internal compiler error: ‘global_options’ are modified in local context 0xc053ab cl_optimization_compare(gcc_options*, gcc_options*) /gcc-master/gcc/options-save.c:9786 0x78122f handle_optimize_attribute ../../../repos/gcc/gcc/c-family/c-attribs.c:4475 0x6663c7 decl_attributes(tree_node**, tree_node*, int, tree_node*) ../../../repos/gcc/gcc/attribs.c:714 0x688beb start_function(c_declspecs*, c_declarator*, tree_node*) ../../../repos/gcc/gcc/c/c-decl.c:9177 0x6f8543 c_parser_declaration_or_fndef ../../../repos/gcc/gcc/c/c-parser.c:2434 0x7037ff c_parser_external_declaration ../../../repos/gcc/gcc/c/c-parser.c:1773 0x704417 c_parser_translation_unit ../../../repos/gcc/gcc/c/c-parser.c:1646 0x704417 c_parse_file() ../../../repos/gcc/gcc/c/c-parser.c:21822 0x7647e7 c_common_parse_file() ../../../repos/gcc/gcc/c-family/c-opts.c:1190 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. ----------- The compiler was built with the default configure for aarch64-linux-gnu and I enabled only the C and C++ languages. Attached is the preprocessed file, and here's the command line that will trigger the ICE. ----------- gcc -nostdinc -mlittle-endian -DKASAN_SHADOW_SCALE_SHIFT=3 -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Wno-format-security -std=gnu89 -mgeneral-regs-only -DCONFIG_CC_HAS_K_CONSTRAINT=1 -fno-asynchronous-unwind-tables -Wno-psabi -mabi=lp64 -mbranch-protection=none -DKASAN_SHADOW_SCALE_SHIFT=3 -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -c core.i ----------- Please let me know if you need more information.