public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor
@ 2023-09-25 12:27 yankel-pro at scialom dot org
2023-09-25 15:10 ` [Bug c++/111592] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: yankel-pro at scialom dot org @ 2023-09-25 12:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
Bug ID: 111592
Summary: ICE on expanding argument pack into variadic
constructor
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: yankel-pro at scialom dot org
Target Milestone: ---
GCC raises an Internal Compiler Error in c_common_parse_file() when
(indirectly, see source) expanding an argument pack into a variadic
constructor.
$ g++ --version
g++
(Compiler-Explorer-Build-gcc-1eb80f78f114f6582c349f75e08b361a0a582091-binutils-2.40)
14.0.0 20230925 (experimental)
$ cat source
struct ignore
{ ignore(...) {} };
template<class... Args>
void
InternalCompilerError(Args... args)
{ ignore{ ignore(args) ... }; }
int
main()
{ InternalCompilerError(0, 0); }
$ g++ -c source
<source>: In instantiation of 'void InternalCompilerError(Args ...) [with Args
= {int, int}]':
<source>:11:24: required from here
<source>:7:3: internal compiler error: in finish_expr_stmt, at
cp/semantics.cc:910
7 | { ignore{ ignore(args) ... }; }
| ^~~~~~
0x251c8ee internal_error(char const*, ...)
???:0
0xae8dda fancy_abort(char const*, int, char const*)
???:0
0xcfa8f8 instantiate_decl(tree_node*, bool, bool)
???:0
0xd2dcbb instantiate_pending_templates(int)
???:0
0xbded50 c_parse_final_cleanups()
???:0
0xe149d8 c_common_parse_file()
???:0
Found on Compiler Explorer <https://godbolt.org/z/M788xE44z>.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/111592] [11/12/13/14 Regression] ICE on expanding argument pack into variadic constructor
2023-09-25 12:27 [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor yankel-pro at scialom dot org
@ 2023-09-25 15:10 ` pinskia at gcc dot gnu.org
2024-03-07 21:52 ` law at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-25 15:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|ICE on expanding argument |[11/12/13/14 Regression]
|pack into variadic |ICE on expanding argument
|constructor |pack into variadic
| |constructor
Last reconfirmed| |2023-09-25
Target Milestone|--- |11.5
Known to work| |5.1.0, 5.5.0
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Known to fail| |6.1.0, 6.2.0
Keywords| |ice-on-valid-code
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/111592] [11/12/13/14 Regression] ICE on expanding argument pack into variadic constructor
2023-09-25 12:27 [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor yankel-pro at scialom dot org
2023-09-25 15:10 ` [Bug c++/111592] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
@ 2024-03-07 21:52 ` law at gcc dot gnu.org
2024-03-12 13:24 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-07 21:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
Jeffrey A. Law <law at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
CC| |law at gcc dot gnu.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/111592] [11/12/13/14 Regression] ICE on expanding argument pack into variadic constructor
2023-09-25 12:27 [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor yankel-pro at scialom dot org
2023-09-25 15:10 ` [Bug c++/111592] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2024-03-07 21:52 ` law at gcc dot gnu.org
@ 2024-03-12 13:24 ` jakub at gcc dot gnu.org
2024-03-12 19:37 ` mpolacek at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-12 13:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
Priority|P1 |P2
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 6-13 has been released with this bug, so P2.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/111592] [11/12/13/14 Regression] ICE on expanding argument pack into variadic constructor
2023-09-25 12:27 [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor yankel-pro at scialom dot org
` (2 preceding siblings ...)
2024-03-12 13:24 ` jakub at gcc dot gnu.org
@ 2024-03-12 19:37 ` mpolacek at gcc dot gnu.org
2024-06-04 20:14 ` [Bug c++/111592] [11/12/13/14/15 " simartin at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-03-12 19:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r6-6795-g0fd9d4921f7ba2. But that's only adding an assert so the
problem was probably latent.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/111592] [11/12/13/14/15 Regression] ICE on expanding argument pack into variadic constructor
2023-09-25 12:27 [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor yankel-pro at scialom dot org
` (3 preceding siblings ...)
2024-03-12 19:37 ` mpolacek at gcc dot gnu.org
@ 2024-06-04 20:14 ` simartin at gcc dot gnu.org
2024-07-09 14:11 ` simartin at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-06-04 20:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
Simon Martin <simartin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |simartin at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #4 from Simon Martin <simartin at gcc dot gnu.org> ---
Working on it.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/111592] [11/12/13/14/15 Regression] ICE on expanding argument pack into variadic constructor
2023-09-25 12:27 [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor yankel-pro at scialom dot org
` (4 preceding siblings ...)
2024-06-04 20:14 ` [Bug c++/111592] [11/12/13/14/15 " simartin at gcc dot gnu.org
@ 2024-07-09 14:11 ` simartin at gcc dot gnu.org
2024-07-19 13:21 ` [Bug c++/111592] [12/13/14/15 " rguenth at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-07-09 14:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
--- Comment #5 from Simon Martin <simartin at gcc dot gnu.org> ---
The bug was introduced via
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=9efe5fbde1e8; I will submit a
patch momentarily.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/111592] [12/13/14/15 Regression] ICE on expanding argument pack into variadic constructor
2023-09-25 12:27 [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor yankel-pro at scialom dot org
` (5 preceding siblings ...)
2024-07-09 14:11 ` simartin at gcc dot gnu.org
@ 2024-07-19 13:21 ` rguenth at gcc dot gnu.org
2024-08-07 10:49 ` cvs-commit at gcc dot gnu.org
2024-08-07 10:50 ` simartin at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-07-19 13:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|11.5 |12.5
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11 branch is being closed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/111592] [12/13/14/15 Regression] ICE on expanding argument pack into variadic constructor
2023-09-25 12:27 [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor yankel-pro at scialom dot org
` (6 preceding siblings ...)
2024-07-19 13:21 ` [Bug c++/111592] [12/13/14/15 " rguenth at gcc dot gnu.org
@ 2024-08-07 10:49 ` cvs-commit at gcc dot gnu.org
2024-08-07 10:50 ` simartin at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-08-07 10:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Martin <simartin@gcc.gnu.org>:
https://gcc.gnu.org/g:a1999cbc816ecd382c7af4ca44153379de49dcaf
commit r15-2792-ga1999cbc816ecd382c7af4ca44153379de49dcaf
Author: Simon Martin <simon@nasilyan.com>
Date: Wed Aug 7 12:45:12 2024 +0200
c++: Fix ICE on valid involving variadic constructor [PR111592]
We currently ICE upon the following valid code, due to the fix made through
commit 9efe5fbde1e8
=== cut here ===
struct ignore { ignore(...) {} };
template<class... Args>
void InternalCompilerError(Args... args)
{ ignore{ ignore(args) ... }; }
int main() { InternalCompilerError(0, 0); }
=== cut here ===
Change 9efe5fbde1e8 avoids infinite recursion in build_over_call by
returning
error_mark_node if one invokes ignore::ignore(...) with an argument of type
ignore, because otherwise we end up calling convert_arg_to_ellipsis for
that
argument, and recurse into build_over_call with the exact same parameters.
This patch tightens the condition to only return error_mark_node if there's
one
and only one parameter to the call being processed - otherwise we won't
infinitely recurse.
Successfully tested on x86_64-pc-linux-gnu.
PR c++/111592
gcc/cp/ChangeLog:
* call.cc (build_over_call): Only error out if there's a single
parameter of type A in a call to A::A(...).
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/variadic186.C: New test.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/111592] [12/13/14/15 Regression] ICE on expanding argument pack into variadic constructor
2023-09-25 12:27 [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor yankel-pro at scialom dot org
` (7 preceding siblings ...)
2024-08-07 10:49 ` cvs-commit at gcc dot gnu.org
@ 2024-08-07 10:50 ` simartin at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-08-07 10:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111592
Simon Martin <simartin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
Target Milestone|12.5 |15.0
--- Comment #8 from Simon Martin <simartin at gcc dot gnu.org> ---
Fixed on trunk.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-08-07 10:50 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-25 12:27 [Bug c++/111592] New: ICE on expanding argument pack into variadic constructor yankel-pro at scialom dot org
2023-09-25 15:10 ` [Bug c++/111592] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2024-03-07 21:52 ` law at gcc dot gnu.org
2024-03-12 13:24 ` jakub at gcc dot gnu.org
2024-03-12 19:37 ` mpolacek at gcc dot gnu.org
2024-06-04 20:14 ` [Bug c++/111592] [11/12/13/14/15 " simartin at gcc dot gnu.org
2024-07-09 14:11 ` simartin at gcc dot gnu.org
2024-07-19 13:21 ` [Bug c++/111592] [12/13/14/15 " rguenth at gcc dot gnu.org
2024-08-07 10:49 ` cvs-commit at gcc dot gnu.org
2024-08-07 10:50 ` simartin 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).