public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103804] New: ICE: 'global_options' are modified in local context
@ 2021-12-22 10:59 asolokha at gmx dot com
2021-12-22 12:26 ` [Bug target/103804] " marxin at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2021-12-22 10:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103804
Bug ID: 103804
Summary: ICE: 'global_options' are modified in local context
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
CC: marxin at gcc dot gnu.org
Target Milestone: ---
Target: powerpc-*-linux-gnu
gcc, at least configured for powerpc target and invoked w/ -mcpu= set to a
value valid to that target, ICEs when compiling testcases w/ explicitly wrong
(non-powerpc)
#pragrma GCC target ("")
statements and
__attribute__ ((optimize ()))
set on a function.
The following testcase was extracted from
gcc/testsuite/gcc.target/aarch64/vect-widen-add.c:
#pragma GCC target "+nosve"
#define ARR_SIZE 1024
__attribute__((optimize (0))) void
uadd_nonopt (unsigned int *foo, unsigned short int *a, unsigned short int *b)
{
for( int i = 0; i < ARR_SIZE - 3;i=i+4)
{
foo[i] = a[i] + b[i];
foo[i+1] = a[i+1] + b[i+1];
foo[i+2] = a[i+2] + b[i+2];
foo[i+3] = a[i+3] + b[i+3];
}
}
% powerpc-e300c3-linux-gnu-gcc-12.0.0 -mcpu=401 -c mpvyvgwx.c
mpvyvgwx.c:1:9: error: #pragma GCC target '+nosve' is invalid
1 | #pragma GCC target "+nosve"
| ^~~
mpvyvgwx.c:7:1: internal compiler error: 'global_options' are modified in local
context
7 | {
| ^
0xd9f405 cl_optimization_compare(gcc_options*, gcc_options*)
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211219/work/build/gcc/options-save.c:14201
0x921b69 handle_optimize_attribute
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211219/work/gcc-12-20211219/gcc/c-family/c-attribs.c:5507
0x8161f7 decl_attributes(tree_node**, tree_node*, int, tree_node*)
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211219/work/gcc-12-20211219/gcc/attribs.c:867
0x834f08 start_function(c_declspecs*, c_declarator*, tree_node*)
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211219/work/gcc-12-20211219/gcc/c/c-decl.c:9516
0x8983aa c_parser_declaration_or_fndef
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211219/work/gcc-12-20211219/gcc/c/c-parser.c:2445
0x8a0eeb c_parser_external_declaration
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211219/work/gcc-12-20211219/gcc/c/c-parser.c:1779
0x8a176b c_parser_translation_unit
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211219/work/gcc-12-20211219/gcc/c/c-parser.c:1652
0x8a176b c_parse_file()
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211219/work/gcc-12-20211219/gcc/c/c-parser.c:23331
0x9081a9 c_common_parse_file()
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20211219/work/gcc-12-20211219/gcc/c-family/c-opts.c:1238
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/103804] ICE: 'global_options' are modified in local context
2021-12-22 10:59 [Bug target/103804] New: ICE: 'global_options' are modified in local context asolokha at gmx dot com
@ 2021-12-22 12:26 ` marxin at gcc dot gnu.org
2022-01-11 14:36 ` marxin at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-22 12:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103804
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-12-22
Ever confirmed|0 |1
Status|UNCONFIRMED |ASSIGNED
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Mine.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/103804] ICE: 'global_options' are modified in local context
2021-12-22 10:59 [Bug target/103804] New: ICE: 'global_options' are modified in local context asolokha at gmx dot com
2021-12-22 12:26 ` [Bug target/103804] " marxin at gcc dot gnu.org
@ 2022-01-11 14:36 ` marxin at gcc dot gnu.org
2022-01-11 14:36 ` marxin at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-11 14:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103804
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master, can't reproduce.
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master, can't reproduce.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/103804] ICE: 'global_options' are modified in local context
2021-12-22 10:59 [Bug target/103804] New: ICE: 'global_options' are modified in local context asolokha at gmx dot com
2021-12-22 12:26 ` [Bug target/103804] " marxin at gcc dot gnu.org
2022-01-11 14:36 ` marxin at gcc dot gnu.org
@ 2022-01-11 14:36 ` marxin at gcc dot gnu.org
2022-01-12 5:09 ` asolokha at gmx dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-11 14:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103804
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master, can't reproduce.
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master, can't reproduce.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/103804] ICE: 'global_options' are modified in local context
2021-12-22 10:59 [Bug target/103804] New: ICE: 'global_options' are modified in local context asolokha at gmx dot com
` (2 preceding siblings ...)
2022-01-11 14:36 ` marxin at gcc dot gnu.org
@ 2022-01-12 5:09 ` asolokha at gmx dot com
2022-01-12 11:53 ` cvs-commit at gcc dot gnu.org
2022-01-12 11:53 ` marxin at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2022-01-12 5:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103804
Arseny Solokha <asolokha at gmx dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|FIXED |---
Status|RESOLVED |REOPENED
--- Comment #4 from Arseny Solokha <asolokha at gmx dot com> ---
Nope, it still ICEs w/ gcc 20220109 snapshot
(g:49d73c9fb644673323845efebfe6b3106e70af8a). ptr1 and ptr2 passed to
cl_optimization_compare() differ in the following:
--- /tmp/ptr1 2022-01-12 12:04:55.682072663 +0700
+++ /tmp/ptr2 2022-01-12 12:05:37.247041664 +0700
@@ -1305,7 +1305,7 @@
x_secure_plt = 1
x_rs6000_abi_name = 0x1b403a2 "linux"
x_rs6000_compat_align_parm = 0
-x_rs6000_cpu_index = -1
+x_rs6000_cpu_index = 0
x_rs6000_fold_gimple = 1
x_TARGET_NO_FP_IN_TOC = 1
x_TARGET_FRIZ = -1
@@ -1339,7 +1339,7 @@
x_rs6000_stack_protector_guard_reg_str = 0x0
x_rs6000_stack_protector_guard = SSP_TLS
x_rs6000_string_compare_inline_limit = 64
-x_rs6000_tune_index = -1
+x_rs6000_tune_index = 0
x_unroll_only_small_loops = 0
x_rs6000_veclibabi_name = 0x0
x_TARGET_ALTIVEC_VRSAVE = 0
% powerpc-e300c3-linux-gnu-gcc-12.0.0 -mcpu=401 -c tt.c -v
Using built-in specs.
COLLECT_GCC=powerpc-e300c3-linux-gnu-gcc-12.0.0
Target: powerpc-e300c3-linux-gnu
Configured with:
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-12.0.0_p20220109/work/gcc-12-20220109/configure
--host=x86_64-pc-linux-gnu --target=powerpc-e300c3-linux-gnu
--build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/powerpc-e300c3-linux-gnu/gcc-bin/12.0.0
--includedir=/usr/lib/gcc/powerpc-e300c3-linux-gnu/12.0.0/include
--datadir=/usr/share/gcc-data/powerpc-e300c3-linux-gnu/12.0.0
--mandir=/usr/share/gcc-data/powerpc-e300c3-linux-gnu/12.0.0/man
--infodir=/usr/share/gcc-data/powerpc-e300c3-linux-gnu/12.0.0/info
--with-gxx-include-dir=/usr/lib/gcc/powerpc-e300c3-linux-gnu/12.0.0/include/g++-v12
--with-python-dir=/share/gcc-data/powerpc-e300c3-linux-gnu/12.0.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --disable-nls
--disable-libunwind-exceptions --enable-checking=yes --disable-esp
--enable-libstdcxx-time --disable-libstdcxx-pch
--enable-poison-system-directories --with-sysroot=/usr/powerpc-e300c3-linux-gnu
--disable-bootstrap --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --disable-fixed-point --enable-targets=all --enable-libgomp
--disable-libssp --disable-libada --disable-cet --disable-systemtap
--enable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--without-zstd --enable-lto --with-isl --disable-isl-version-check
--disable-libsanitizer --enable-default-pie --enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20220109 (experimental) (GCC)
<…>
% powerpc-e300c3-linux-gnu-gcc-12.0.0 -mcpu=401 -c tt.c -Q --help=target
The following options are target specific:
-G<number> 8
-m32 [enabled]
-m64 [disabled]
-mabi=altivec [disabled]
-mabi=d32 [enabled]
-mabi=d64 [disabled]
-mabi=elfv1 [disabled]
-mabi=elfv2 [disabled]
-mabi=ibmlongdouble [enabled]
-mabi=ieeelongdouble [disabled]
-mabi=no-altivec [enabled]
-mabi=vec-default [enabled]
-mabi=vec-extabi [disabled]
-mads [disabled]
-maix-struct-return [enabled]
-malign- natural
-malign-branch-targets
-mallow-movmisalign [disabled]
-maltivec [disabled]
-malways-hint
-mavoid-indexed-addresses [disabled]
-mbig [enabled]
-mbig-endian [enabled]
-mbionic [disabled]
-mbit-align [disabled]
-mbit-word [disabled]
-mblock-compare-inline-limit= 63
-mblock-compare-inline-loop-limit= -1
-mblock-move-inline-limit= 32
-mblock-ops-unaligned-vsx [disabled]
-mblock-ops-vector-pair [disabled]
-mbss-plt [disabled]
-mcall-ABI linux
-mcmodel= small
-mcmpb [disabled]
-mcompat-align-parm [disabled]
-mcpu= 401
-mcrypto [disabled]
-mdebug=
-mdirect-move [disabled]
-mdlmzb [disabled]
-meabi [disabled]
-mefficient-unaligned-vsx [disabled]
-memb [disabled]
-mfloat128 [disabled]
-mfloat128-convert [disabled]
-mfloat128-hardware [disabled]
-mfold-gimple [enabled]
-mfp-in-toc [disabled]
-mfprnd [disabled]
-mfriz
-mfull-toc [disabled]
-mfused-madd -ffp-contract=fast
-mgen-cell-microcode [ignored]
-mglibc [enabled]
-mgnu-attribute [enabled]
-mhard-dfp [disabled]
-mhard-float [disabled]
-mhtm [disabled]
-mieee128-constant [enabled]
-minsert-sched-nops=
-misel [disabled]
-mlittle [disabled]
-mlittle-endian [disabled]
-mlong-double- 127
-mlongcall [disabled]
-mlra [ignored]
-mmfcrf [disabled]
-mmfpgpr [disabled]
-mminimal-toc [enabled]
-mmma [disabled]
-mmodulo [disabled]
-mmulhw [disabled]
-mmultiple [disabled]
-mmusl [disabled]
-mmvme [disabled]
-mnewlib [disabled]
-mno-fp-in-toc [enabled]
-mno-mfpgpr [ignored]
-mno-string [ignored]
-mno-sum-in-toc [disabled]
-mno-toc [disabled]
-mno-traceback [disabled]
-mno-update [disabled]
-moptimize-swaps [enabled]
-mpcrel [disabled]
-mpcrel-opt [disabled]
-mpltseq [enabled]
-mpointers-to-nested-functions [enabled]
-mpopcntb [disabled]
-mpopcntd [disabled]
-mpower10 [disabled]
-mpower10-fusion [disabled]
-mpower10-fusion-2add [disabled]
-mpower10-fusion-2logical [disabled]
-mpower10-fusion-2store [disabled]
-mpower10-fusion-add-logical [disabled]
-mpower10-fusion-ld-cmpi [disabled]
-mpower10-fusion-logical-add [disabled]
-mpower8-fusion [disabled]
-mpower8-fusion-sign [disabled]
-mpower8-vector [disabled]
-mpower9-minmax [disabled]
-mpower9-misc [disabled]
-mpower9-vector [disabled]
-mpowerpc [ignored]
-mpowerpc-gfxopt [disabled]
-mpowerpc-gpopt [disabled]
-mpowerpc64 [disabled]
-mprefixed [disabled]
-mprioritize-restricted-insns= 0
-mprivileged [disabled]
-mprofile-kernel [disabled]
-mprototype [disabled]
-mquad-memory [disabled]
-mquad-memory-atomic [disabled]
-mreadonly-in-sdata [enabled]
-mrecip [disabled]
-mrecip-precision [disabled]
-mrecip=
-mregnames [disabled]
-mrelative-jumptables [enabled]
-mrelocatable [disabled]
-mrelocatable-lib [disabled]
-mrop-protect [disabled]
-msave-toc-indirect [enabled]
-msched-costly-dep=
-msched-epilog [enabled]
-msched-groups
-msched-prolog [enabled]
-msdata [disabled]
-msdata=[none,data,sysv,eabi] data
-msecure-plt [enabled]
-mshlib [disabled]
-msim [disabled]
-msingle-pic-base [disabled]
-msoft-float [enabled]
-mspeculate-indirect-jumps [enabled]
-msplat-float-constant [enabled]
-msplat-word-constant [enabled]
-mstack-protector-guard-offset=
-mstack-protector-guard-reg=
-mstack-protector-guard= tls
-mstrict-align [disabled]
-mstring [disabled]
-mstring-compare-inline-limit= 64
-msum-in-toc [enabled]
-msvr4-struct-return [disabled]
-mtls-size=[16,32] 32
-mtoc [disabled]
-mtraceback=[full,part,no] [default]
-mtune= 401
-muclibc [disabled]
-munroll-only-small-loops [disabled]
-mupdate [enabled]
-mveclibabi=
-mvrsave [disabled]
-mvrsave=no -mvrsave
-mvrsave=yes -mvrsave
-mvsx [disabled]
-mvsx-align-128 [disabled]
-mvsx-timode [ignored]
-mwarn-altivec-long [enabled]
-mxl-compat [disabled]
-myellowknife [disabled]
<…>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/103804] ICE: 'global_options' are modified in local context
2021-12-22 10:59 [Bug target/103804] New: ICE: 'global_options' are modified in local context asolokha at gmx dot com
` (3 preceding siblings ...)
2022-01-12 5:09 ` asolokha at gmx dot com
@ 2022-01-12 11:53 ` cvs-commit at gcc dot gnu.org
2022-01-12 11:53 ` marxin at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-12 11:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103804
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:
https://gcc.gnu.org/g:4960516df2f90e6ae16aa03c63c8bf2c702e6bc4
commit r12-6519-g4960516df2f90e6ae16aa03c63c8bf2c702e6bc4
Author: Martin Liska <mliska@suse.cz>
Date: Wed Jan 12 12:48:33 2022 +0100
opts: do not do sanity check when an error is seen
PR target/103804
gcc/c-family/ChangeLog:
* c-attribs.c (handle_optimize_attribute): Do not call
cl_optimization_compare if we seen an error.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/103804] ICE: 'global_options' are modified in local context
2021-12-22 10:59 [Bug target/103804] New: ICE: 'global_options' are modified in local context asolokha at gmx dot com
` (4 preceding siblings ...)
2022-01-12 11:53 ` cvs-commit at gcc dot gnu.org
@ 2022-01-12 11:53 ` marxin at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-12 11:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103804
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-01-12 11:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22 10:59 [Bug target/103804] New: ICE: 'global_options' are modified in local context asolokha at gmx dot com
2021-12-22 12:26 ` [Bug target/103804] " marxin at gcc dot gnu.org
2022-01-11 14:36 ` marxin at gcc dot gnu.org
2022-01-11 14:36 ` marxin at gcc dot gnu.org
2022-01-12 5:09 ` asolokha at gmx dot com
2022-01-12 11:53 ` cvs-commit at gcc dot gnu.org
2022-01-12 11:53 ` marxin at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).