public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109431] New: internal compiler error: in output_constructor_regular_field (varasm.c:5207)
@ 2023-04-06 8:27 gh0s-t at yandex dot ru
2023-04-06 9:40 ` [Bug c++/109431] " pinskia at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: gh0s-t at yandex dot ru @ 2023-04-06 8:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109431
Bug ID: 109431
Summary: internal compiler error: in
output_constructor_regular_field (varasm.c:5207)
Product: gcc
Version: 9.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gh0s-t at yandex dot ru
Target Milestone: ---
Created attachment 54815
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54815&action=edit
preprocessed file for short source example
Problem occurs from 9.1 to newer gcc versions. But code compiles on older
convenient gcc versions. godbolt.org used.
As I can see, the problem is in function body static and constexpr keywords
mixing at array aggregate initialization with empty initializer-list (at line
#111 in preprocessed file).
Using built-in specs.
COLLECT_GCC=/opt/compiler-explorer/gcc-9.1.0/bin/g++
Target: x86_64-linux-gnu
Configured with: ../gcc-9.1.0/configure
--prefix=/opt/compiler-explorer/gcc-build/staging --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap
--enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --enable-clocale=gnu --enable-languages=c,c++,fortran,ada
--enable-ld=yes --enable-gold=yes --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-linker-build-id --enable-lto
--enable-plugins --enable-threads=posix
--with-pkgversion=Compiler-Explorer-Build
Thread model: posix
gcc version 9.1.0 (Compiler-Explorer-Build)
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-g' '-o' '/app/output.s'
'-masm=intel' '-S' '-v' '-std=c++17' '-g' '-D' '_REENTRANT' '-fPIC' '-pipe'
'-Wall' '-Wextra' '-fsanitize=undefined' '-fno-strict-aliasing' '-fwrapv'
'-fno-aggressive-loop-optimizations' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
/opt/compiler-explorer/gcc-9.1.0/bin/../libexec/gcc/x86_64-linux-gnu/9.1.0/cc1plus
-quiet -v -imultiarch x86_64-linux-gnu -iprefix
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/
-D_GNU_SOURCE -D _REENTRANT <source> -quiet -dumpbase example.cpp -masm=intel
-mtune=generic -march=x86-64 -auxbase-strip /app/output.s -g -g -Wall -Wextra
-std=c++17 -version -fdiagnostics-color=always -fPIC -fsanitize=undefined
-fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations -o
/app/output.s
GNU C++17 (Compiler-Explorer-Build) version 9.1.0 (x86_64-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../x86_64-linux-gnu/include"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0/backward"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/include"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/include-fixed"
ignoring nonexistent directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0/x86_64-linux-gnu
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0/backward
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/include
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/include-fixed
/usr/local/include
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C++17 (Compiler-Explorer-Build) version 9.1.0 (x86_64-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 2c5ce497dfd6253343a5b735244577eb
<source>: In function 'int main()':
<source>:105:16: warning: variable 's' set but not used
[-Wunused-but-set-variable]
105 | auto const s = parameterLimits<float>(ParamId::Id1);
| ^
<source>: At global scope:
<source>:107:1: internal compiler error: in output_constructor_regular_field,
at varasm.c:5207
107 | }
| ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
ASM generation compiler returned: 1
Using built-in specs.
COLLECT_GCC=/opt/compiler-explorer/gcc-9.1.0/bin/g++
COLLECT_LTO_WRAPPER=/opt/compiler-explorer/gcc-9.1.0/bin/../libexec/gcc/x86_64-linux-gnu/9.1.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../gcc-9.1.0/configure
--prefix=/opt/compiler-explorer/gcc-build/staging --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap
--enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --enable-clocale=gnu --enable-languages=c,c++,fortran,ada
--enable-ld=yes --enable-gold=yes --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-linker-build-id --enable-lto
--enable-plugins --enable-threads=posix
--with-pkgversion=Compiler-Explorer-Build
Thread model: posix
gcc version 9.1.0 (Compiler-Explorer-Build)
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-g' '-o' '/app/output.s' '-v'
'-std=c++17' '-g' '-D' '_REENTRANT' '-fPIC' '-pipe' '-Wall' '-Wextra'
'-fsanitize=undefined' '-fno-strict-aliasing' '-fwrapv'
'-fno-aggressive-loop-optimizations' '-L.' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
/opt/compiler-explorer/gcc-9.1.0/bin/../libexec/gcc/x86_64-linux-gnu/9.1.0/cc1plus
-quiet -v -imultiarch x86_64-linux-gnu -iprefix
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/
-D_GNU_SOURCE -D _REENTRANT <source> -quiet -dumpbase example.cpp
-mtune=generic -march=x86-64 -auxbase example -g -g -Wall -Wextra -std=c++17
-version -fdiagnostics-color=always -fPIC -fsanitize=undefined
-fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations -o - |
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../x86_64-linux-gnu/bin/as
-v --64 -o /tmp/ccOkx2if.o
GNU assembler version 2.29.1 (x86_64-linux-gnu) using BFD version
(Compiler-Explorer-Build) 2.29.1
GNU C++17 (Compiler-Explorer-Build) version 9.1.0 (x86_64-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../x86_64-linux-gnu/include"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0/backward"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/include"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/include-fixed"
ignoring nonexistent directory
"/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0/x86_64-linux-gnu
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../include/c++/9.1.0/backward
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/include
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/include-fixed
/usr/local/include
/opt/compiler-explorer/gcc-9.1.0/bin/../lib/gcc/../../include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C++17 (Compiler-Explorer-Build) version 9.1.0 (x86_64-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 2c5ce497dfd6253343a5b735244577eb
<source>: In function 'int main()':
<source>:105:16: warning: variable 's' set but not used
[-Wunused-but-set-variable]
105 | auto const s = parameterLimits<float>(ParamId::Id1);
| ^
<source>: At global scope:
<source>:107:1: internal compiler error: in output_constructor_regular_field,
at varasm.c:5207
107 | }
| ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
Execution build compiler returned: 1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/109431] internal compiler error: in output_constructor_regular_field (varasm.c:5207)
2023-04-06 8:27 [Bug c++/109431] New: internal compiler error: in output_constructor_regular_field (varasm.c:5207) gh0s-t at yandex dot ru
@ 2023-04-06 9:40 ` pinskia at gcc dot gnu.org
2023-04-06 9:42 ` [Bug c++/109431] [10/11/12/13 Regression] internal compiler error: in output_constructor_regular_field with static constexpr array inside a template constexpr function pinskia at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-06 9:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109431
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced:
```
struct RangeLimits
{
int low = 0;
int high = 1;
constexpr RangeLimits() { }
};
template <int>
int parameterLimits(void)
{
static RangeLimits constexpr param_limits[ 2 ] = {};
auto const &limits = param_limits[ 1 ];
return 0;
}
auto s = parameterLimits<1>();
```
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/109431] [10/11/12/13 Regression] internal compiler error: in output_constructor_regular_field with static constexpr array inside a template constexpr function
2023-04-06 8:27 [Bug c++/109431] New: internal compiler error: in output_constructor_regular_field (varasm.c:5207) gh0s-t at yandex dot ru
2023-04-06 9:40 ` [Bug c++/109431] " pinskia at gcc dot gnu.org
@ 2023-04-06 9:42 ` pinskia at gcc dot gnu.org
2023-04-06 13:16 ` mpolacek at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-06 9:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109431
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.5
Known to fail| |9.1.0
Status|UNCONFIRMED |NEW
Keywords| |ice-on-valid-code,
| |needs-bisection
Known to work| |8.5.0
Ever confirmed|0 |1
Summary|internal compiler error: in |[10/11/12/13 Regression]
|output_constructor_regular_ |internal compiler error: in
|field (varasm.c:5207) |output_constructor_regular_
| |field with static constexpr
| |array inside a template
| |constexpr function
Last reconfirmed| |2023-04-06
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/109431] [10/11/12/13 Regression] internal compiler error: in output_constructor_regular_field with static constexpr array inside a template constexpr function
2023-04-06 8:27 [Bug c++/109431] New: internal compiler error: in output_constructor_regular_field (varasm.c:5207) gh0s-t at yandex dot ru
2023-04-06 9:40 ` [Bug c++/109431] " pinskia at gcc dot gnu.org
2023-04-06 9:42 ` [Bug c++/109431] [10/11/12/13 Regression] internal compiler error: in output_constructor_regular_field with static constexpr array inside a template constexpr function pinskia at gcc dot gnu.org
@ 2023-04-06 13:16 ` mpolacek at gcc dot gnu.org
2023-04-11 12:40 ` rguenth at gcc dot gnu.org
2023-07-07 10:45 ` [Bug c++/109431] [11/12/13/14 Regression] ICE in output_constructor_regular_field with static constexpr array inside a template constexpr function since r9-1483-g307193b82cecb8 rguenth at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-04-06 13:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109431
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|needs-bisection |
CC| |mpolacek at gcc dot gnu.org
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r262173:
commit 307193b82cecb8ab79cf8880d642e1a3acb9c9f6
Author: Jason Merrill <jason@redhat.com>
Date: Tue Jun 26 22:59:44 2018 -0400
PR c++/86320 - memory-hog with std::array of pair
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/109431] [10/11/12/13 Regression] internal compiler error: in output_constructor_regular_field with static constexpr array inside a template constexpr function
2023-04-06 8:27 [Bug c++/109431] New: internal compiler error: in output_constructor_regular_field (varasm.c:5207) gh0s-t at yandex dot ru
` (2 preceding siblings ...)
2023-04-06 13:16 ` mpolacek at gcc dot gnu.org
@ 2023-04-11 12:40 ` rguenth at gcc dot gnu.org
2023-07-07 10:45 ` [Bug c++/109431] [11/12/13/14 Regression] ICE in output_constructor_regular_field with static constexpr array inside a template constexpr function since r9-1483-g307193b82cecb8 rguenth at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-11 12:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109431
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/109431] [11/12/13/14 Regression] ICE in output_constructor_regular_field with static constexpr array inside a template constexpr function since r9-1483-g307193b82cecb8
2023-04-06 8:27 [Bug c++/109431] New: internal compiler error: in output_constructor_regular_field (varasm.c:5207) gh0s-t at yandex dot ru
` (3 preceding siblings ...)
2023-04-11 12:40 ` rguenth at gcc dot gnu.org
@ 2023-07-07 10:45 ` rguenth at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109431
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.5 |11.5
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-07-07 10:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 8:27 [Bug c++/109431] New: internal compiler error: in output_constructor_regular_field (varasm.c:5207) gh0s-t at yandex dot ru
2023-04-06 9:40 ` [Bug c++/109431] " pinskia at gcc dot gnu.org
2023-04-06 9:42 ` [Bug c++/109431] [10/11/12/13 Regression] internal compiler error: in output_constructor_regular_field with static constexpr array inside a template constexpr function pinskia at gcc dot gnu.org
2023-04-06 13:16 ` mpolacek at gcc dot gnu.org
2023-04-11 12:40 ` rguenth at gcc dot gnu.org
2023-07-07 10:45 ` [Bug c++/109431] [11/12/13/14 Regression] ICE in output_constructor_regular_field with static constexpr array inside a template constexpr function since r9-1483-g307193b82cecb8 rguenth 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).