[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2021-03-16 Thread arnd at linaro dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860
Bug 92860 depends on bug 99592, which changed state.

Bug 99592 Summary: arm: internal compiler error using arm_neon.h with -pg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99592

   What|Removed |Added

 Status|RESOLVED|WAITING
 Resolution|FIXED   |---

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2021-03-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860
Bug 92860 depends on bug 99592, which changed state.

Bug 99592 Summary: arm: internal compiler error using arm_neon.h with -pg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99592

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-12-11 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

Martin Liška  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
   Target Milestone|10.3|12.0

--- Comment #41 from Martin Liška  ---
I'm planning to work on that for GCC 12.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-07-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|10.2|10.3

--- Comment #40 from Richard Biener  ---
GCC 10.2 is released, adjusting target milestone.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-07-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #39 from Martin Liška  ---
(In reply to Arseny Solokha from comment #38)
> JFTR I can easily reproduce it e.g. in the following setup:
> 
> % powerpc-e300c3-linux-gnu-gcc-11.0.0 -mcpu=power9 -c
> gcc/testsuite/gcc.target/s390/target-attribute/tpragma-struct-vx-1.c
> gcc/testsuite/gcc.target/s390/target-attribute/tpragma-struct-vx-1.c:10:9:
> error: #pragma GCC target 'arch=z13' is invalid
>10 | #pragma GCC target ("arch=z13,vx")
>   | ^~~
> gcc/testsuite/gcc.target/s390/target-attribute/tpragma-struct-vx-1.c:10:9:
> error: #pragma GCC target 'vx' is invalid
> gcc/testsuite/gcc.target/s390/target-attribute/tpragma-struct-vx-1.c:23:9:
> internal compiler error: 'global_options' are modified in local context
>23 | #pragma GCC pop_options
>   | ^~~
> 0xd89fc5 cl_optimization_compare(gcc_options*, gcc_options*)
>   
> /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/
> work/build/gcc/options-save.c:10459
> 0x9196b6 handle_pragma_pop_options
>   
> /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/
> work/gcc-11-20200705/gcc/c-family/c-pragma.c:1090
> 0x895510 c_parser_pragma
>   
> /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/
> work/gcc-11-20200705/gcc/c/c-parser.c:12544
> 0x8b7c75 c_parser_external_declaration
>   
> /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/
> work/gcc-11-20200705/gcc/c/c-parser.c:1754
> 0x8b82b1 c_parser_translation_unit
>   
> /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/
> work/gcc-11-20200705/gcc/c/c-parser.c:1646
> 0x8b82b1 c_parse_file()
>   
> /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/
> work/gcc-11-20200705/gcc/c/c-parser.c:21822
> 0x916cb7 c_common_parse_file()
>   
> /var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/
> work/gcc-11-20200705/gcc/c-family/c-opts.c:1190

Thank you for the test-case, but it's not much useful, it's an ice-on-invalid
code.

Fails due to:
(gdb) p ptr1->x_rs6000_cpu_index
$1 = 51
(gdb) p ptr2->x_rs6000_cpu_index
$2 = -1

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-07-05 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

Arseny Solokha  changed:

   What|Removed |Added

 CC||asolokha at gmx dot com

--- Comment #38 from Arseny Solokha  ---
JFTR I can easily reproduce it e.g. in the following setup:

% powerpc-e300c3-linux-gnu-gcc-11.0.0 -mcpu=power9 -c
gcc/testsuite/gcc.target/s390/target-attribute/tpragma-struct-vx-1.c
gcc/testsuite/gcc.target/s390/target-attribute/tpragma-struct-vx-1.c:10:9:
error: #pragma GCC target 'arch=z13' is invalid
   10 | #pragma GCC target ("arch=z13,vx")
  | ^~~
gcc/testsuite/gcc.target/s390/target-attribute/tpragma-struct-vx-1.c:10:9:
error: #pragma GCC target 'vx' is invalid
gcc/testsuite/gcc.target/s390/target-attribute/tpragma-struct-vx-1.c:23:9:
internal compiler error: 'global_options' are modified in local context
   23 | #pragma GCC pop_options
  | ^~~
0xd89fc5 cl_optimization_compare(gcc_options*, gcc_options*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/work/build/gcc/options-save.c:10459
0x9196b6 handle_pragma_pop_options
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/work/gcc-11-20200705/gcc/c-family/c-pragma.c:1090
0x895510 c_parser_pragma
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/work/gcc-11-20200705/gcc/c/c-parser.c:12544
0x8b7c75 c_parser_external_declaration
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/work/gcc-11-20200705/gcc/c/c-parser.c:1754
0x8b82b1 c_parser_translation_unit
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/work/gcc-11-20200705/gcc/c/c-parser.c:1646
0x8b82b1 c_parse_file()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/work/gcc-11-20200705/gcc/c/c-parser.c:21822
0x916cb7 c_common_parse_file()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200705/work/gcc-11-20200705/gcc/c-family/c-opts.c:1190

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-25 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #37 from Martin Liška  ---
Which is quite strange difference.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #36 from David Binderman  ---
(In reply to Martin Liška from comment #35)
> Btw. can you run the failing compilation in gdb and list where exactly it
> fails (which option name is different)?

Shown previous runs indicate the first test in routine cl_optimization_compare.
So field x_help_flag.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #35 from Martin Liška  ---
Btw. can you run the failing compilation in gdb and list where exactly it fails
(which option name is different)?

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #34 from Martin Liška  ---
I don't have to do anything special in order to get pre-processed source file:

$ gcc pr88876.c -freport-bug 
pr88876.c:10:1: internal compiler error: ‘global_options’ are modified in local
context
   10 | int c() {return 0;}
  | ^~~
0xce038b cl_optimization_compare(gcc_options*, gcc_options*)
/dev/shm/objdir/gcc/options-save.c:9822
0x8c4f88 handle_optimize_attribute
/home/marxin/Programming/gcc/gcc/c-family/c-attribs.c:4475
0x7d4ee7 decl_attributes(tree_node**, tree_node*, int, tree_node*)
/home/marxin/Programming/gcc/gcc/attribs.c:714
0x7f1625 start_function(c_declspecs*, c_declarator*, tree_node*)
/home/marxin/Programming/gcc/gcc/c/c-decl.c:9177
0x84bdb7 c_parser_declaration_or_fndef
/home/marxin/Programming/gcc/gcc/c/c-parser.c:2434
0x855453 c_parser_external_declaration
/home/marxin/Programming/gcc/gcc/c/c-parser.c:1773
0x855f51 c_parser_translation_unit
/home/marxin/Programming/gcc/gcc/c/c-parser.c:1646
0x855f51 c_parse_file()
/home/marxin/Programming/gcc/gcc/c/c-parser.c:21822
0x8ae88b c_common_parse_file()
/home/marxin/Programming/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  for instructions.
Preprocessed source stored into /tmp/cc8jx9U7.out file, please attach this to
your bugreport.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #33 from David Binderman  ---
(In reply to Martin Liška from comment #32)
> Thank you very much. I'll wait for a test-case by you ;)

I have had a go, but I cannot generate an intermediate file.

I've tried various ways to get options-save.c to crash.
This is my most recent effort:

struct S {
int a;
int b;
};

void
cl_optimization_compare (gcc_options *ptr1, gcc_options *ptr2)
{
  if (ptr1->x_help_flag != ptr2->x_help_flag) {
S * p = 0;
fprintf( stderr, "%d\n", p->a);
internal_error ("% are modified in local context");
  }

I also tried integer division by zero, which didn't seem to work.

If anyone has any better ideas on generating a crash, I would be glad 
to hear about them.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #32 from Martin Liška  ---
> I am busy with other stuff right now, but by the weekend, I should be
> able to enhance routine internal_error to produce a preprocessed source
> code file and so we can make progress.

Thank you very much. I'll wait for a test-case by you ;)

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #31 from David Binderman  ---
(In reply to Martin Liška from comment #30)
> What's the project where you see the issue?

Chatterino2, in fedora rawhide.

Be warned, you will need my environment for gcc to see the problem.

More thought suggests that in a usual crash, I get a preprocessed
file, because I have -freport-bug switched on.

In this case, source code file gcc/options-save.c
explicitly calls routine internal_error, which doesn't produce a 
preprocessed file and so I cannot make progress.

I am busy with other stuff right now, but by the weekend, I should be
able to enhance routine internal_error to produce a preprocessed source
code file and so we can make progress.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #30 from Martin Liška  ---
(In reply to David Binderman from comment #29)
> Maybe I've been slightly less than clear, but to quote myself:
> >anything I do to reduce the problem makes it go away

Ah, ok!

> 
> So I can't provide a small test case, or output from -E, for this.
> 
> I suggest I wait until the rest of the bug is solved, retest
> and go from there.
> 
> My apologies for the lack of clarity.

What's the project where you see the issue?

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #29 from David Binderman  ---
Maybe I've been slightly less than clear, but to quote myself:
>anything I do to reduce the problem makes it go away

So I can't provide a small test case, or output from -E, for this.

I suggest I wait until the rest of the bug is solved, retest
and go from there.

My apologies for the lack of clarity.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #28 from Martin Liška  ---
> Confirmation sought that the stack backtrace I provided shows
> that the problem is a bug in the pre-processor.

No, the problem is in C parser.

> 
> If so, -E isn't going to help.

Please attach it.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #27 from David Binderman  ---
(In reply to Martin Liška from comment #25)
> Yes, it's definitely related.
> Please attach -E file and a command line.

Problem stills exists in the g++ compiler dated 20200623, but anything 
I do to reduce the problem makes it go away ;-<

Confirmation sought that the stack backtrace I provided shows
that the problem is a bug in the pre-processor. 

If so, -E isn't going to help.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #26 from Martin Liška  ---
One more arc-linux case:

{ OPT_LEVELS_SIZE, OPT_mcase_vector_pcrel, NULL, 1 },
{ OPT_LEVELS_SIZE, OPT_msize_level_, NULL, 3 },
{ OPT_LEVELS_SIZE, OPT_mmillicode, NULL, 1 },
{ OPT_LEVELS_3_PLUS_SPEED_ONLY, OPT_msize_level_, NULL, 0 },
{ OPT_LEVELS_3_PLUS_SPEED_ONLY, OPT_malign_call, NULL, 1 },

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #25 from Martin Liška  ---
(In reply to David Binderman from comment #24)
> Is this error message related ?
> 
> /home/dcb/gcc/results.20200611/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/
> xsaveoptintrin.h:55:9: internal compiler error: Error: global_options are
> modified in local context
> 
>55 | #pragma GCC pop_options
>   | ^~~
> 0xe6fefe cl_optimization_compare(gcc_options*, gcc_options*)
>   /home/dcb/gcc/working/gcc/options-save.c:0
> 0x97c7b9 handle_pragma_pop_options(cpp_reader*)
>   ../../trunk.git/gcc/c-family/c-pragma.c:1090
> 0x7a0565 cp_parser_pragma(cp_parser*, pragma_context, bool*)
>   ../../trunk.git/gcc/cp/parser.c:43983
> 0x79d432 cp_parser_toplevel_declaration(cp_parser*)
>   ../../trunk.git/gcc/cp/parser.c:13502
> 
> It seems to be a preprocessor crash, so I don't know how to reduce
> the test case.

Yes, it's definitely related.
Please attach -E file and a command line.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-11 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

David Binderman  changed:

   What|Removed |Added

 CC||dcb314 at hotmail dot com

--- Comment #24 from David Binderman  ---
Is this error message related ?

/home/dcb/gcc/results.20200611/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/xsaveoptintrin.h:55:9:
internal compiler error: Error: global_options are modified in local context

   55 | #pragma GCC pop_options
  | ^~~
0xe6fefe cl_optimization_compare(gcc_options*, gcc_options*)
/home/dcb/gcc/working/gcc/options-save.c:0
0x97c7b9 handle_pragma_pop_options(cpp_reader*)
../../trunk.git/gcc/c-family/c-pragma.c:1090
0x7a0565 cp_parser_pragma(cp_parser*, pragma_context, bool*)
../../trunk.git/gcc/cp/parser.c:43983
0x79d432 cp_parser_toplevel_declaration(cp_parser*)
../../trunk.git/gcc/cp/parser.c:13502

It seems to be a preprocessor crash, so I don't know how to reduce
the test case.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

Martin Liška  changed:

   What|Removed |Added

   Assignee|marxin at gcc dot gnu.org  |unassigned at gcc dot 
gnu.org
 Status|ASSIGNED|NEW

--- Comment #23 from Martin Liška  ---
We've mitigated the majority of the collisions and I've added a sanitization
checking. I'll keep the issue opened and I'm unassigning.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-06-10 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #22 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/g:dc6d15eaa23cbae1468a6ef92371b1c856c14819

commit r11-1141-gdc6d15eaa23cbae1468a6ef92371b1c856c14819
Author: Martin Liska 
Date:   Tue Dec 10 19:41:08 2019 +0100

Add gcc_assert that &global_options are not dirty modified.

gcc/ChangeLog:

2020-03-20  Martin Liska  

PR tree-optimization/92860
* optc-save-gen.awk: Generate new function cl_optimization_compare.
* opth-gen.awk: Generate declaration of the function.

gcc/c-family/ChangeLog:

2020-03-20  Martin Liska  

PR tree-optimization/92860
* c-attribs.c (handle_optimize_attribute):
Save global options and compare it after parsing of function
attribute.
* c-pragma.c (opt_stack::saved_global_options): New field.
(handle_pragma_push_options): Save global_options.
(handle_pragma_pop_options): Compare them after pop.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-05-29 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

Eric Gallager  changed:

   What|Removed |Added

 CC||dmalcolm at gcc dot gnu.org

--- Comment #21 from Eric Gallager  ---
(In reply to Segher Boessenkool from comment #20)
> We are in stage 1 now (for GCC 11), so nothing should be deferred now.

I thought the "deferred" keyword was a backward-looking one, meant to mark bugs
that had been deferred from previous releases and thus deserve a higher
priority now, not ones that are currently being deferred to something in the
future (that's what the SUSPENDED status is for). cc-ing David Malcolm who
originally came up with the keyword

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-05-29 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #20 from Segher Boessenkool  ---
We are in stage 1 now (for GCC 11), so nothing should be deferred now.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-05-29 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #19 from Eric Gallager  ---
(In reply to Martin Liška from comment #18)
> @egallager: Why did you add 'deferred' keyword? I sent a patch for it to GCC
> patches mailing list.

because:

(In reply to Richard Biener from comment #16)
> Re-target to GCC 10, definitely not material for backporting unless we
> discover critical issues (that should be individually backported). 
> Eventually fully fixed only for GCC 11.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-05-25 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #18 from Martin Liška  ---
@egallager: Why did you add 'deferred' keyword? I sent a patch for it to GCC
patches mailing list.

[Bug tree-optimization/92860] [8/9/10/11 regression] Global flags affected by -O settings are clobbered by optimize attribute

2020-05-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|10.0|10.2

--- Comment #17 from Jakub Jelinek  ---
GCC 10.1 has been released.