public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision
@ 2021-03-18 12:39 ensadc at mailnesia dot com
  2021-03-18 13:20 ` [Bug c++/99643] [8/9/10/11 Regression] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ensadc at mailnesia dot com @ 2021-03-18 12:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99643
           Summary: internal compiler error in build_over_call, involving
                    array new and copy elision
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ensadc at mailnesia dot com
  Target Milestone: ---

https://godbolt.org/z/8TWG9d

====
struct Foo {};
Foo get_foo();

int main() {
    new Foo[1]{get_foo()};
}

====
<source>: In function 'int main()':
<source>:5:25: internal compiler error: in build_over_call, at cp/call.c:9360
    5 |     new Foo[1]{get_foo()};
      |                         ^
0x1cfa0d9 internal_error(char const*, ...)
        ???:0
0x6ba797 fancy_abort(char const*, int, char const*)
        ???:0
0x6df07c build_new_method_call(...)
        ???:0
0x6e07e0 build_special_member_call(...)
        ???:0
0x76a7cf ocp_convert(...)
        ???:0
0x7f46a8 build_aggr_init(tree_node*, tree_node*, int, int)
        ???:0
0x7f30c0 build_vec_init(...)
        ???:0
0x7f8051 build_new(...)
        ???:0
0x8e12dd c_parse_file()
        ???:0
0xa5f8d2 c_common_parse_file()
        ???:0
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.
====

This seems like a regression from GCC 10.

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

* [Bug c++/99643] [8/9/10/11 Regression] internal compiler error in build_over_call, involving array new and copy elision
  2021-03-18 12:39 [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision ensadc at mailnesia dot com
@ 2021-03-18 13:20 ` jakub at gcc dot gnu.org
  2021-04-03 16:48 ` jason at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-18 13:20 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
             Status|UNCONFIRMED                 |NEW
   Target Milestone|---                         |8.5
     Ever confirmed|0                           |1
                 CC|                            |jakub at gcc dot gnu.org
            Summary|internal compiler error in  |[8/9/10/11 Regression]
                   |build_over_call, involving  |internal compiler error in
                   |array new and copy elision  |build_over_call, involving
                   |                            |array new and copy elision
   Last reconfirmed|                            |2021-03-18

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r7-3564-gb7558a2c1f87e374c48fa2be8e3ab93e1b3c68b0

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

* [Bug c++/99643] [8/9/10/11 Regression] internal compiler error in build_over_call, involving array new and copy elision
  2021-03-18 12:39 [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision ensadc at mailnesia dot com
  2021-03-18 13:20 ` [Bug c++/99643] [8/9/10/11 Regression] " jakub at gcc dot gnu.org
@ 2021-04-03 16:48 ` jason at gcc dot gnu.org
  2021-04-04  0:59 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-03 16:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/99643] [8/9/10/11 Regression] internal compiler error in build_over_call, involving array new and copy elision
  2021-03-18 12:39 [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision ensadc at mailnesia dot com
  2021-03-18 13:20 ` [Bug c++/99643] [8/9/10/11 Regression] " jakub at gcc dot gnu.org
  2021-04-03 16:48 ` jason at gcc dot gnu.org
@ 2021-04-04  0:59 ` cvs-commit at gcc dot gnu.org
  2021-04-04  1:00 ` [Bug c++/99643] [8/9/10 " jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-04  0:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:c3d3bb0f03dbd02512ab46979088ee8e22520c24

commit r11-7980-gc3d3bb0f03dbd02512ab46979088ee8e22520c24
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Apr 3 16:17:29 2021 -0400

    c++: array new initialized from a call [PR99643]

    Here the get_foo() call results in a TARGET_EXPR, which we strip in
    massage_init_elt, but then when build_vec_init tries to use it to
initialize
    the array element we crash because build_aggr_init expects a class rvalue
to
    have a TARGET_EXPR.  So don't strip it.

    The stripping was added in r206639 for PR59659, so I checked that removing
    it didn't significantly increase compile time or memory usage for that
    testcase; compile time was unaffected, memory usage increased by 0.00004%.

    gcc/cp/ChangeLog:

            PR c++/99643
            * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.

    gcc/testsuite/ChangeLog:

            PR c++/99643
            * g++.dg/cpp0x/initlist-new5.C: New test.

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

* [Bug c++/99643] [8/9/10 Regression] internal compiler error in build_over_call, involving array new and copy elision
  2021-03-18 12:39 [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision ensadc at mailnesia dot com
                   ` (2 preceding siblings ...)
  2021-04-04  0:59 ` cvs-commit at gcc dot gnu.org
@ 2021-04-04  1:00 ` jason at gcc dot gnu.org
  2021-05-14  9:54 ` [Bug c++/99643] [9/10 " jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-04  1:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[8/9/10/11 Regression]      |[8/9/10 Regression]
                   |internal compiler error in  |internal compiler error in
                   |build_over_call, involving  |build_over_call, involving
                   |array new and copy elision  |array new and copy elision

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for GCC 11 so far.

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

* [Bug c++/99643] [9/10 Regression] internal compiler error in build_over_call, involving array new and copy elision
  2021-03-18 12:39 [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision ensadc at mailnesia dot com
                   ` (3 preceding siblings ...)
  2021-04-04  1:00 ` [Bug c++/99643] [8/9/10 " jason at gcc dot gnu.org
@ 2021-05-14  9:54 ` jakub at gcc dot gnu.org
  2021-05-20 21:34 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|8.5                         |9.4

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.

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

* [Bug c++/99643] [9/10 Regression] internal compiler error in build_over_call, involving array new and copy elision
  2021-03-18 12:39 [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision ensadc at mailnesia dot com
                   ` (4 preceding siblings ...)
  2021-05-14  9:54 ` [Bug c++/99643] [9/10 " jakub at gcc dot gnu.org
@ 2021-05-20 21:34 ` cvs-commit at gcc dot gnu.org
  2021-06-01  8:19 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-05-20 21:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r10-9843-gdce71e0a274f58fe7cbabba8760f78469ba13548
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Apr 3 16:17:29 2021 -0400

    c++: array new initialized from a call [PR99643]

    Here the get_foo() call results in a TARGET_EXPR, which we strip in
    massage_init_elt, but then when build_vec_init tries to use it to
initialize
    the array element we crash because build_aggr_init expects a class rvalue
to
    have a TARGET_EXPR.  So don't strip it.

    The stripping was added in r206639 for PR59659, so I checked that removing
    it didn't significantly increase compile time or memory usage for that
    testcase; compile time was unaffected, memory usage increased by 0.00004%.

    gcc/cp/ChangeLog:

            PR c++/99643
            * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.

    gcc/testsuite/ChangeLog:

            PR c++/99643
            * g++.dg/cpp0x/initlist-new5.C: New test.

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

* [Bug c++/99643] [9/10 Regression] internal compiler error in build_over_call, involving array new and copy elision
  2021-03-18 12:39 [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision ensadc at mailnesia dot com
                   ` (5 preceding siblings ...)
  2021-05-20 21:34 ` cvs-commit at gcc dot gnu.org
@ 2021-06-01  8:19 ` rguenth at gcc dot gnu.org
  2022-05-13 17:42 ` [Bug c++/99643] [9 " cvs-commit at gcc dot gnu.org
  2022-05-13 17:59 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug c++/99643] [9 Regression] internal compiler error in build_over_call, involving array new and copy elision
  2021-03-18 12:39 [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision ensadc at mailnesia dot com
                   ` (6 preceding siblings ...)
  2021-06-01  8:19 ` rguenth at gcc dot gnu.org
@ 2022-05-13 17:42 ` cvs-commit at gcc dot gnu.org
  2022-05-13 17:59 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-13 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:4231a43fd4ac6ccffd4d4b7cca70d45b2368cede

commit r9-10176-g4231a43fd4ac6ccffd4d4b7cca70d45b2368cede
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Apr 3 16:17:29 2021 -0400

    c++: array new initialized from a call [PR99643]

    Here the get_foo() call results in a TARGET_EXPR, which we strip in
    massage_init_elt, but then when build_vec_init tries to use it to
initialize
    the array element we crash because build_aggr_init expects a class rvalue
to
    have a TARGET_EXPR.  So don't strip it.

    The stripping was added in r206639 for PR59659, so I checked that removing
    it didn't significantly increase compile time or memory usage for that
    testcase; compile time was unaffected, memory usage increased by 0.00004%.

    gcc/cp/ChangeLog:

            PR c++/99643
            * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.

    gcc/testsuite/ChangeLog:

            PR c++/99643
            * g++.dg/cpp0x/initlist-new5.C: New test.

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

* [Bug c++/99643] [9 Regression] internal compiler error in build_over_call, involving array new and copy elision
  2021-03-18 12:39 [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision ensadc at mailnesia dot com
                   ` (7 preceding siblings ...)
  2022-05-13 17:42 ` [Bug c++/99643] [9 " cvs-commit at gcc dot gnu.org
@ 2022-05-13 17:59 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2022-05-13 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 9.5/10.4/11.

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

end of thread, other threads:[~2022-05-13 17:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 12:39 [Bug c++/99643] New: internal compiler error in build_over_call, involving array new and copy elision ensadc at mailnesia dot com
2021-03-18 13:20 ` [Bug c++/99643] [8/9/10/11 Regression] " jakub at gcc dot gnu.org
2021-04-03 16:48 ` jason at gcc dot gnu.org
2021-04-04  0:59 ` cvs-commit at gcc dot gnu.org
2021-04-04  1:00 ` [Bug c++/99643] [8/9/10 " jason at gcc dot gnu.org
2021-05-14  9:54 ` [Bug c++/99643] [9/10 " jakub at gcc dot gnu.org
2021-05-20 21:34 ` cvs-commit at gcc dot gnu.org
2021-06-01  8:19 ` rguenth at gcc dot gnu.org
2022-05-13 17:42 ` [Bug c++/99643] [9 " cvs-commit at gcc dot gnu.org
2022-05-13 17:59 ` jason 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).