[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #15 from Martin Liška  ---
Fixed.

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

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

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

commit r11-6612-ge91910d3576eeac714c93ec25ea3b15012007903
Author: Martin Liska 
Date:   Tue Jan 12 13:20:18 2021 +0100

options: properly compare string arguments

Similarly to 7f967bd2a7ba156ede3fbb147e66dea5fb7137a6, we need to
compare string with strcmp.

gcc/ChangeLog:

PR c++/97284
* optc-save-gen.awk: Compare also n_target_save vars with
strcmp.

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

--- Comment #13 from Martin Liška  ---
I've got a patch candidate, testing right now.

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

--- Comment #12 from Martin Liška  ---
So it's caused by PCH:

$ cat qt.ii
[empty]

$ cat q.ii
#pragma GCC pch_preprocess "cmake_pch.hxx.gch"
#pragma GCC push_options
#pragma GCC target ""
#pragma GCC pop_options

$ g++ -x c++-header qt.ii -o cmake_pch.hxx.gch && g++ q.ii -c
q.ii:4:9: internal compiler error: ‘global_options’ are modified in local
context
4 | #pragma GCC pop_options
  | ^~~
0x115df28 cl_optimization_compare(gcc_options*, gcc_options*)
/dev/shm/objdir/gcc/options-save.c:15271
0xcbc30e handle_pragma_pop_options
/home/marxin/Programming/gcc/gcc/c-family/c-pragma.c:1092
0xcbcdb7 c_invoke_pragma_handler(unsigned int)
/home/marxin/Programming/gcc/gcc/c-family/c-pragma.c:1515
0xb346ad cp_parser_pragma
/home/marxin/Programming/gcc/gcc/cp/parser.c:45062
0xb693ab cp_parser_toplevel_declaration
/home/marxin/Programming/gcc/gcc/cp/parser.c:14096
0xb693ab cp_parser_translation_unit
/home/marxin/Programming/gcc/gcc/cp/parser.c:4936
0xb693ab c_parse_file()
/home/marxin/Programming/gcc/gcc/cp/parser.c:45121
0xcb4669 c_common_parse_file()
/home/marxin/Programming/gcc/gcc/c-family/c-opts.c:1211
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #11 from Martin Liška  ---
Good, I placed a couple of '#include ' and I can reproduce it now.
Thanks for the report.

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread ville.voutilainen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

--- Comment #10 from Ville Voutilainen  ---
Right - that's the Qt bug I'm hoping to fix, but I don't get far because of the
ICE. :) The libstdc++ headers have been reorganized, so Qt's expectations that
numeric_limits is available without including  are no longer valid with
GCC 11.

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

--- Comment #9 from Martin Liška  ---
(In reply to Ville Voutilainen from comment #8)
> Also, you can just try the actual build, if you follow
> https://wiki.qt.io/Building_Qt_6_from_Git

I tried, but it fails quite fast with:

/home/marxin/bin/gcc/bin/c++ -DHAVE_CONFIG_H -DPCRE2_CODE_UNIT_WIDTH=16
-DPCRE2_DISABLE_JIT -DQT_BOOTSTRAPPED -DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_USE_QSTRINGBUILDER
-DQT_VERSION_MAJOR=6 -DQT_VERSION_MINOR=0 -DQT_VERSION_PATCH=1
-DQT_VERSION_STR=\"6.0.1\" -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
-I../qtbase/src/tools/bootstrap/../../3rdparty/pcre2/src
-Iqtbase/src/corelib/Core_autogen/include -Iqtbase/include
-Iqtbase/include/QtCore -I../qtbase/src/corelib -Iqtbase/src/corelib
-Iqtbase/src/corelib/global -I../qtbase/src/corelib/../3rdparty/tinycbor/src
-Iqtbase/include/QtCore/6.0.1 -Iqtbase/include/QtCore/6.0.1/QtCore
-I../qtbase/src/corelib/../3rdparty/forkfd -Iqtbase/src/corelib/.rcc
-I../qtbase/mkspecs/linux-g++ -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -Iqtbase/src/xml/Xml_autogen/include
-Iqtbase/include/QtXml -I../qtbase/src/xml -Iqtbase/src/xml
-Iqtbase/include/QtXml/6.0.1 -Iqtbase/include/QtXml/6.0.1/QtXml
-I../qtbase/src/tools/bootstrap/..
-I../qtbase/src/tools/bootstrap/../../3rdparty/tinycbor/src -DNDEBUG -O2 -fPIC
-fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra
-ffunction-sections -fdata-sections -Wsuggest-override -std=gnu++17 -MD -MT
qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/global/qfloat16.cpp.o
-MF
qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/global/qfloat16.cpp.o.d
-o
qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/global/qfloat16.cpp.o
-c ../qtbase/src/corelib/global/qfloat16.cpp
In file included from qtbase/include/QtCore/qanystringview.h:1,
 from
qtbase/include/QtCore/../../../../qtbase/src/corelib/text/qstring.h:56,
 from qtbase/include/QtCore/qstring.h:1,
 from
qtbase/include/QtCore/../../../../qtbase/src/corelib/tools/qhashfunctions.h:44,
 from qtbase/include/QtCore/qhashfunctions.h:1,
 from
qtbase/include/QtCore/../../../../qtbase/src/corelib/tools/qvarlengtharray.h:47,
 from qtbase/include/QtCore/qvarlengtharray.h:1,
 from
qtbase/include/QtCore/../../../../qtbase/src/corelib/kernel/qmetatype.h:49,
 from qtbase/include/QtCore/qmetatype.h:1,
 from ../qtbase/src/corelib/global/qfloat16.h:45,
 from ../qtbase/src/corelib/global/qfloat16.cpp:41:
qtbase/include/QtCore/../../../../qtbase/src/corelib/text/qanystringview.h:250:46:
error: ‘numeric_limits’ is not a member of ‘std’
  250 | static constexpr size_t SizeMask =
(std::numeric_limits::max)() / 4;
  |  ^~
qtbase/include/QtCore/../../../../qtbase/src/corelib/text/qanystringview.h:250:67:
error: expected primary-expression before ‘>’ token
  250 | static constexpr size_t SizeMask =
(std::numeric_limits::max)() / 4;
  |   ^
qtbase/include/QtCore/../../../../qtbase/src/corelib/text/qanystringview.h:250:70:
error: ‘::max’ has not been declared; did you mean ‘std::max’?
  250 | static constexpr size_t SizeMask =
(std::numeric_limits::max)() / 4;
  | 
^~~
  | 
std::max
In file included from /home/marxin/bin/gcc/include/c++/11.0.0/algorithm:62,
 from
qtbase/include/QtCore/../../../../qtbase/src/corelib/global/qglobal.h:126,
 from qtbase/include/QtCore/qglobal.h:1,
 from ../qtbase/src/corelib/global/qfloat16.h:44,
 from ../qtbase/src/corelib/global/qfloat16.cpp:41:
/home/marxin/bin/gcc/include/c++/11.0.0/bits/stl_algo.h:3467:5: note:
‘std::max’ declared here
 3467 | max(initializer_list<_Tp> __l, _Compare __comp)
  | ^~~
In file included from qtbase/include/QtCore/qanystringview.h:1,
 from
qtbase/include/QtCore/../../../../qtbase/src/corelib/text/qstring.h:56,
 from qtbase/include/QtCore/qstring.h:1,
 from
qtbase/include/QtCore/../../../../qtbase/src/corelib/tools/qhashfunctions.h:44,
 from qtbase/include/QtCore/qhashfunctions.h:1,
 from
qtbase/include/QtCore/../../../../qtbase/src/corelib/tools/qvarlengtharray.h:47,
 from qtbase/include/QtCore/qvarlengtharray.h:1,
 from
qtbase/include/QtCore/../../../../qtbase/src/corelib/kernel/qmetatype.h:49,
 from qtbase/include/QtCore/qmetatype.h:1,
 from ../qtbase/src/corelib/global/qfloat16.h:45,
 from 

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread ville.voutilainen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

--- Comment #8 from Ville Voutilainen  ---
Also, you can just try the actual build, if you follow
https://wiki.qt.io/Building_Qt_6_from_Git

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread ville.voutilainen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

--- Comment #7 from Ville Voutilainen  ---
(In reply to Martin Liška from comment #5)
> Still can't reproduce it.
> Please send me also output of --verbose.

Yeah, I fed that output to g++, and then it compiles just fine. But when it's
in the actual build with all the -MD -MT -MF flags, it doesn't. Those are, btw,
in case it's of any help,
-MD -MT qtbase/qmake/CMakeFiles/qmake.dir/__/src/corelib/global/qendian.cpp.o
-MF qtbase/qmake/CMakeFiles/qmake.dir/__/src/corelib/global/qendian.cpp.o.d -o
qtbase/qmake/CMakeFiles/qmake.dir/__/src/corelib/global/qendian.cpp.o

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread ville.voutilainen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

--- Comment #6 from Ville Voutilainen  ---
Created attachment 49946
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49946=edit
Output of --verbose

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

--- Comment #5 from Martin Liška  ---
Still can't reproduce it.
Please send me also output of --verbose.

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread ville.voutilainen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

--- Comment #4 from Ville Voutilainen  ---
Created attachment 49943
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49943=edit
Output of gcc -E

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-12 Thread ville.voutilainen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

--- Comment #3 from Ville Voutilainen  ---
..or maybe I'm just too dumb to invoke g++ -E properly, and the rest of the
options confuse the compiler.

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2021-01-11 Thread ville.voutilainen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

Ville Voutilainen  changed:

   What|Removed |Added

 CC||ville.voutilainen at gmail dot 
com

--- Comment #2 from Ville Voutilainen  ---
(In reply to Martin Liška from comment #1)
> Please provide a pre-processed soure file (-E option).

The output of gcc -E for this build is empty, so sure looks like the crash
is in the preprocessor.

[Bug c++/97284] internal compiler error: 'global_options' are modified in local context

2020-10-05 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97284

Martin Liška  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |WAITING
 CC||marxin at gcc dot gnu.org
   Last reconfirmed||2020-10-05

--- Comment #1 from Martin Liška  ---
Please provide a pre-processed soure file (-E option).