public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
@ 2020-11-18 23:51 florin.iucha at amd dot com
  2020-11-18 23:53 ` [Bug c++/97899] " florin.iucha at amd dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: florin.iucha at amd dot com @ 2020-11-18 23:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

            Bug ID: 97899
           Summary: internal compiler error: in split_nonconstant_init_1,
                    at cp/typeck2.c:626
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: florin.iucha at amd dot com
  Target Milestone: ---

Created attachment 49589
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49589&action=edit
c++ source code

gcc version 11.0.0 20201115 (experimental) (GCC) built from
c746fc40f4ec8cfc1092efd49d567751858d2099 (equivalent to
https://gcc.gnu.org/pub/gcc/snapshots/LATEST-11/gcc-11-20201115.tar.xz)

Backtrace:

$ /opt/gcc11-for-tng/bin/g++-11 -std=c++17 -O3 -c pack-fail.cpp
pack-fail.cpp: In member function 'int Baz<Foo>::otherTest()':
pack-fail.cpp:37:58: internal compiler error: in split_nonconstant_init_1, at
cp/typeck2.c:626
   37 |         const auto address = uint64_t{packUint(low, high)};
      |                                                          ^
0x7224d6 split_nonconstant_init_1
        ../../gcc/gcc/cp/typeck2.c:626
0xb3238f split_nonconstant_init(tree_node*, tree_node*)
        ../../gcc/gcc/cp/typeck2.c:657
0x99ac66 check_initializer
        ../../gcc/gcc/cp/decl.c:6909
0x9bebcd cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:7699
0xa69587 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:21362
0xa475a3 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:13943
0xa63dfd cp_parser_declaration_statement
        ../../gcc/gcc/cp/parser.c:13342
0xa4935f cp_parser_statement
        ../../gcc/gcc/cp/parser.c:11588
0xa4a46d cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:11954
0xa4a548 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:11904
0xa63f65 cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:23551
0xa63f65 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:23602
0xa68800 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:29492
0xa68c4c cp_parser_late_parsing_for_member
        ../../gcc/gcc/cp/parser.c:30394
0xa4482b cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:24664
0xa45723 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:24688
0xa45723 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:17943
0xa466b9 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:14565
0xa70215 cp_parser_single_declaration
        ../../gcc/gcc/cp/parser.c:29888
0xa70596 cp_parser_template_declaration_after_parameters
        ../../gcc/gcc/cp/parser.c:29552
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


Source code for pack-fail.cpp is attached.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
@ 2020-11-18 23:53 ` florin.iucha at amd dot com
  2020-11-19  0:12 ` [Bug c++/97899] [11 Regression] " mpolacek at gcc dot gnu.org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: florin.iucha at amd dot com @ 2020-11-18 23:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

--- Comment #1 from Florin Iucha <florin.iucha at amd dot com> ---
Created attachment 49590
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49590&action=edit
pre-processed source file

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
  2020-11-18 23:53 ` [Bug c++/97899] " florin.iucha at amd dot com
@ 2020-11-19  0:12 ` mpolacek at gcc dot gnu.org
  2020-11-19  0:13 ` florin.iucha at amd dot com
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19  0:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-11-19
           Keywords|                            |ice-on-valid-code
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Target Milestone|---                         |11.0
            Summary|internal compiler error: in |[11 Regression] internal
                   |split_nonconstant_init_1,   |compiler error: in
                   |at cp/typeck2.c:626         |split_nonconstant_init_1,
                   |                            |at cp/typeck2.c:626
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed, thanks for reporting this.

Reducing...

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
  2020-11-18 23:53 ` [Bug c++/97899] " florin.iucha at amd dot com
  2020-11-19  0:12 ` [Bug c++/97899] [11 Regression] " mpolacek at gcc dot gnu.org
@ 2020-11-19  0:13 ` florin.iucha at amd dot com
  2020-11-19  0:21 ` mpolacek at gcc dot gnu.org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: florin.iucha at amd dot com @ 2020-11-19  0:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

--- Comment #3 from Florin Iucha <florin.iucha at amd dot com> ---
gcc version 11.0.0 20201108 (previous snapshot) is compiling fine.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (2 preceding siblings ...)
  2020-11-19  0:13 ` florin.iucha at amd dot com
@ 2020-11-19  0:21 ` mpolacek at gcc dot gnu.org
  2020-11-19  0:23 ` florin.iucha at amd dot com
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19  0:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r11-4959.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (3 preceding siblings ...)
  2020-11-19  0:21 ` mpolacek at gcc dot gnu.org
@ 2020-11-19  0:23 ` florin.iucha at amd dot com
  2020-11-19  0:32 ` mpolacek at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: florin.iucha at amd dot com @ 2020-11-19  0:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

--- Comment #5 from Florin Iucha <florin.iucha at amd dot com> ---
Curious, were you able to reduce it further, or just bisected it?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (4 preceding siblings ...)
  2020-11-19  0:23 ` florin.iucha at amd dot com
@ 2020-11-19  0:32 ` mpolacek at gcc dot gnu.org
  2020-11-19  0:32 ` florin.iucha at amd dot com
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19  0:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Reduced:

// PR c++/97899

template <typename T>
T fn(T a)
{
  return a;
}

template <typename>
struct C {
  void bar() {
    int d = 42;
    const int i = int{fn(d)};
  }
};

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (5 preceding siblings ...)
  2020-11-19  0:32 ` mpolacek at gcc dot gnu.org
@ 2020-11-19  0:32 ` florin.iucha at amd dot com
  2020-11-19  1:19 ` mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: florin.iucha at amd dot com @ 2020-11-19  0:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

--- Comment #7 from Florin Iucha <florin.iucha at amd dot com> ---
Cool, thank you!

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (6 preceding siblings ...)
  2020-11-19  0:32 ` florin.iucha at amd dot com
@ 2020-11-19  1:19 ` mpolacek at gcc dot gnu.org
  2020-11-19  8:58 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19  1:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Reduced even more:

// PR c++/97899

template <typename T = int>
int fn()
{
  return 1;
}

template <typename T>
void bar() {
  const int i = int{fn()};
}

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (7 preceding siblings ...)
  2020-11-19  1:19 ` mpolacek at gcc dot gnu.org
@ 2020-11-19  8:58 ` rguenth at gcc dot gnu.org
  2020-11-19 10:00 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-19  8:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (8 preceding siblings ...)
  2020-11-19  8:58 ` rguenth at gcc dot gnu.org
@ 2020-11-19 10:00 ` marxin at gcc dot gnu.org
  2020-11-20 21:52 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-19 10:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
@Marek: Please do not forget to CC the author of a culprit revision ;)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (9 preceding siblings ...)
  2020-11-19 10:00 ` marxin at gcc dot gnu.org
@ 2020-11-20 21:52 ` jason at gcc dot gnu.org
  2020-11-24 19:58 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jason at gcc dot gnu.org @ 2020-11-20 21:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jason at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (10 preceding siblings ...)
  2020-11-20 21:52 ` jason at gcc dot gnu.org
@ 2020-11-24 19:58 ` cvs-commit at gcc dot gnu.org
  2020-11-24 19:58 ` jason at gcc dot gnu.org
  2022-06-27 18:56 ` cvs-commit at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-24 19:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:92a30040c8d3ea4899979ec41a7e8e6a625c438d

commit r11-5323-g92a30040c8d3ea4899979ec41a7e8e6a625c438d
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Nov 20 16:50:20 2020 -0500

    c++: ICE with int{} in template. [PR97899]

    split_nonconstant_init_1 was confused by a CONSTRUCTOR with non-aggregate
    type, which (with COMPOUND_LITERAL_P set) we use in a template to represent
    a braced functional cast.  It seems to me that there's no good reason to do
    split_nonconstant_init at all in a template.

    gcc/cp/ChangeLog:

            PR c++/97899
            * typeck2.c (store_init_value): Don't split_nonconstant_init in a
            template.

    gcc/testsuite/ChangeLog:

            PR c++/97899
            * g++.dg/cpp0x/initlist-template3.C: New test.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (11 preceding siblings ...)
  2020-11-24 19:58 ` cvs-commit at gcc dot gnu.org
@ 2020-11-24 19:58 ` jason at gcc dot gnu.org
  2022-06-27 18:56 ` cvs-commit at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: jason at gcc dot gnu.org @ 2020-11-24 19:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c++/97899] [11 Regression] internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626
  2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
                   ` (12 preceding siblings ...)
  2020-11-24 19:58 ` jason at gcc dot gnu.org
@ 2022-06-27 18:56 ` cvs-commit at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-06-27 18:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97899

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:508231d54405ac9f120cf30c28cd6eb10ceded30

commit r13-1303-g508231d54405ac9f120cf30c28cd6eb10ceded30
Author: Marek Polacek <polacek@redhat.com>
Date:   Mon Jun 27 14:52:58 2022 -0400

    c++: Add fixed test [PR89197]

    Fixed since bug 97899 was fixed.

            PR c++/89197

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/initlist130.C: New test.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-06-27 18:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 23:51 [Bug c++/97899] New: internal compiler error: in split_nonconstant_init_1, at cp/typeck2.c:626 florin.iucha at amd dot com
2020-11-18 23:53 ` [Bug c++/97899] " florin.iucha at amd dot com
2020-11-19  0:12 ` [Bug c++/97899] [11 Regression] " mpolacek at gcc dot gnu.org
2020-11-19  0:13 ` florin.iucha at amd dot com
2020-11-19  0:21 ` mpolacek at gcc dot gnu.org
2020-11-19  0:23 ` florin.iucha at amd dot com
2020-11-19  0:32 ` mpolacek at gcc dot gnu.org
2020-11-19  0:32 ` florin.iucha at amd dot com
2020-11-19  1:19 ` mpolacek at gcc dot gnu.org
2020-11-19  8:58 ` rguenth at gcc dot gnu.org
2020-11-19 10:00 ` marxin at gcc dot gnu.org
2020-11-20 21:52 ` jason at gcc dot gnu.org
2020-11-24 19:58 ` cvs-commit at gcc dot gnu.org
2020-11-24 19:58 ` jason at gcc dot gnu.org
2022-06-27 18:56 ` cvs-commit 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).