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

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).