public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99063] New: [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842
@ 2021-02-10 17:08 gscfq@t-online.de
  2021-02-10 17:58 ` [Bug c++/99063] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gscfq@t-online.de @ 2021-02-10 17:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99063
           Summary: [9/10/11 Regression] ICE in prep_operand, at
                    cp/call.c:5842
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started with r8 (before 20180525) :


$ cat z1.cc
template <typename... a>
void f (a... n)
{
  do; while (--n); {}
}
void g ()
{
  f(3);
}


$ cat z2.cc
template <typename... a>
void f (a... n)
{
  do; while (n--); {}
}
void g ()
{
  f(1,2);
}


$ g++-11-20210207 -c z1.cc
z1.cc: In instantiation of 'void f(a ...) [with a = {int}]':
z1.cc:8:6:   required from here
z1.cc:4:14: internal compiler error: Segmentation fault
    4 |   do; while (--n); {}
      |              ^~~
0xcd922f crash_signal
        ../../gcc/toplev.c:327
0x66567d prep_operand
        ../../gcc/cp/call.c:5842
0x677955 build_new_op_1
        ../../gcc/cp/call.c:6224
0x6786c0 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
        ../../gcc/cp/call.c:6676
0x80d982 build_x_unary_op(unsigned int, tree_code, cp_expr, int)
        ../../gcc/cp/typeck.c:6136
0x7b5e11 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:19737
0x7c6a67 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:19084
0x7c65f8 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18411
0x7c5c17 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18475
0x7ba4f3 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:25835
0x7ba4f3 instantiate_body
        ../../gcc/cp/pt.c:25835
0x7bb580 instantiate_decl(tree_node*, bool, bool)
        ../../gcc/cp/pt.c:26124
0x7d5bab instantiate_pending_templates(int)
        ../../gcc/cp/pt.c:26203
0x6ecab2 c_parse_final_cleanups()
        ../../gcc/cp/decl2.c:4965

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

* [Bug c++/99063] [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842
  2021-02-10 17:08 [Bug c++/99063] New: [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842 gscfq@t-online.de
@ 2021-02-10 17:58 ` mpolacek at gcc dot gnu.org
  2021-02-10 18:01 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-10 17:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2021-02-10
   Target Milestone|---                         |9.4

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r247842:

commit 0ea37ae178ba156ec9f88134acc4bb13665c56ef
Author: Jason Merrill <jason@redhat.com>
Date:   Wed May 10 11:56:09 2017 -0400

    PR c++/79549 - C++17 ICE with non-type auto template parameter pack

            * pt.c (convert_template_argument): Just return an argument pack.
            (coerce_template_parameter_pack, template_parm_to_arg)
            (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
            (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
            Don't set the type of a NONTYPE_ARGUMENT_PACK.
            * parser.c (make_char_string_pack, make_string_pack): Likewise.

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

* [Bug c++/99063] [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842
  2021-02-10 17:08 [Bug c++/99063] New: [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842 gscfq@t-online.de
  2021-02-10 17:58 ` [Bug c++/99063] " mpolacek at gcc dot gnu.org
@ 2021-02-10 18:01 ` mpolacek at gcc dot gnu.org
  2021-02-11  3:44 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-10 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug c++/99063] [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842
  2021-02-10 17:08 [Bug c++/99063] New: [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842 gscfq@t-online.de
  2021-02-10 17:58 ` [Bug c++/99063] " mpolacek at gcc dot gnu.org
  2021-02-10 18:01 ` mpolacek at gcc dot gnu.org
@ 2021-02-11  3:44 ` mpolacek at gcc dot gnu.org
  2021-02-11 16:14 ` cvs-commit at gcc dot gnu.org
  2021-02-11 16:16 ` [Bug c++/99063] [9/10 " mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-11  3:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I have a fix.

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

* [Bug c++/99063] [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842
  2021-02-10 17:08 [Bug c++/99063] New: [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-02-11  3:44 ` mpolacek at gcc dot gnu.org
@ 2021-02-11 16:14 ` cvs-commit at gcc dot gnu.org
  2021-02-11 16:16 ` [Bug c++/99063] [9/10 " mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-11 16:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r11-7192-gf0da1c0cb7661ee9111bc475efddae80a026de34
Author: Marek Polacek <polacek@redhat.com>
Date:   Wed Feb 10 22:51:30 2021 -0500

    c++: ICE with unexpanded pack in do-while [PR99063]

    Here an unexpanded parameter pack snuck into prep_operand which doesn't
    expect to see an operand without a type, and since r247842
    NONTYPE_ARGUMENT_PACK doesn't have a type anymore.

    This only happens with the do-while loop whose condition may not
    contain a declaration so we never called finish_cond which checks
    for unexpanded parameter packs.  So use check_for_bare_parameter_packs
    to remedy that.

    gcc/cp/ChangeLog:

            PR c++/99063
            * semantics.c (finish_do_stmt): Check for unexpanded parameter
packs.

    gcc/testsuite/ChangeLog:

            PR c++/99063
            * g++.dg/cpp0x/variadic-crash6.C: New test.

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

* [Bug c++/99063] [9/10 Regression] ICE in prep_operand, at cp/call.c:5842
  2021-02-10 17:08 [Bug c++/99063] New: [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-02-11 16:14 ` cvs-commit at gcc dot gnu.org
@ 2021-02-11 16:16 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-11 16:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10/11 Regression] ICE in |[9/10 Regression] ICE in
                   |prep_operand, at            |prep_operand, at
                   |cp/call.c:5842              |cp/call.c:5842
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed in GCC 11.  Invalid code so probably not worth backporting.

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

end of thread, other threads:[~2021-02-11 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10 17:08 [Bug c++/99063] New: [9/10/11 Regression] ICE in prep_operand, at cp/call.c:5842 gscfq@t-online.de
2021-02-10 17:58 ` [Bug c++/99063] " mpolacek at gcc dot gnu.org
2021-02-10 18:01 ` mpolacek at gcc dot gnu.org
2021-02-11  3:44 ` mpolacek at gcc dot gnu.org
2021-02-11 16:14 ` cvs-commit at gcc dot gnu.org
2021-02-11 16:16 ` [Bug c++/99063] [9/10 " mpolacek 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).