public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111919] New: [14 Regression] ICE: tree check: did not expect class 'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144 on valid code
@ 2023-10-22  9:45 zsojka at seznam dot cz
  2023-10-22 14:50 ` [Bug c++/111919] " ppalka at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: zsojka at seznam dot cz @ 2023-10-22  9:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111919
           Summary: [14 Regression] ICE: tree check: did not expect class
                    'type', have 'type' (integer_type) in
                    contains_placeholder_p, at tree.cc:4144 on valid code
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 56168
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56168&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.C
testcase.C: In function 'void Receive()':
testcase.C:11:34: internal compiler error: tree check: did not expect class
'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144
   11 |   s.i[0 / (int) sizeof (int)] |= 0;
      |                                  ^
0x9596f7 tree_not_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /repo/gcc-trunk/gcc/tree.cc:9046
0xf0be06 non_type_check(tree_node*, char const*, int, char const*)
        /repo/gcc-trunk/gcc/tree.h:3807
0x1abcb74 contains_placeholder_p(tree_node const*)
        /repo/gcc-trunk/gcc/tree.cc:4147
0x1abccbc contains_placeholder_p(tree_node const*)
        /repo/gcc-trunk/gcc/tree.cc:4113
0x1abffaa save_expr(tree_node*)
        /repo/gcc-trunk/gcc/tree.cc:3972
0x1ac04d1 stabilize_reference(tree_node*)
        /repo/gcc-trunk/gcc/tree.cc:4859
0x115154e cp_build_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
        /repo/gcc-trunk/gcc/cp/typeck.cc:9510
0xecc896 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
        /repo/gcc-trunk/gcc/cp/call.cc:7312
0x11526b5 build_x_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
tree_node*, int)
        /repo/gcc-trunk/gcc/cp/typeck.cc:9721
0x1041ac4 cp_parser_assignment_expression
        /repo/gcc-trunk/gcc/cp/parser.cc:10605
0x1041c63 cp_parser_expression
        /repo/gcc-trunk/gcc/cp/parser.cc:10734
0x1046647 cp_parser_expression_statement
        /repo/gcc-trunk/gcc/cp/parser.cc:12933
0x1051cbd cp_parser_statement
        /repo/gcc-trunk/gcc/cp/parser.cc:12713
0x1052e47 cp_parser_statement_seq_opt
        /repo/gcc-trunk/gcc/cp/parser.cc:13182
0x1053077 cp_parser_compound_statement
        /repo/gcc-trunk/gcc/cp/parser.cc:13036
0x1074224 cp_parser_function_body
        /repo/gcc-trunk/gcc/cp/parser.cc:25554
0x1074224 cp_parser_ctor_initializer_opt_and_function_body
        /repo/gcc-trunk/gcc/cp/parser.cc:25605
0x107a25e cp_parser_function_definition_after_declarator
        /repo/gcc-trunk/gcc/cp/parser.cc:32267
0x107b6f7 cp_parser_function_definition_from_specifiers_and_declarator
        /repo/gcc-trunk/gcc/cp/parser.cc:32184
0x107b6f7 cp_parser_init_declarator
        /repo/gcc-trunk/gcc/cp/parser.cc:23015
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-4820-20231022022105-g11f50716eee-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-4820-20231022022105-g11f50716eee-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231022 (experimental) (GCC)

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

* [Bug c++/111919] [14 Regression] ICE: tree check: did not expect class 'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144 on valid code
  2023-10-22  9:45 [Bug c++/111919] New: [14 Regression] ICE: tree check: did not expect class 'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144 on valid code zsojka at seznam dot cz
@ 2023-10-22 14:50 ` ppalka at gcc dot gnu.org
  2023-10-23 14:55 ` dcb314 at hotmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-10-22 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org
                 CC|                            |ppalka at gcc dot gnu.org
     Ever confirmed|0                           |1
   Target Milestone|---                         |14.0
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2023-10-22

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Started with r14-4793-gdad311874ac3b3

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

* [Bug c++/111919] [14 Regression] ICE: tree check: did not expect class 'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144 on valid code
  2023-10-22  9:45 [Bug c++/111919] New: [14 Regression] ICE: tree check: did not expect class 'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144 on valid code zsojka at seznam dot cz
  2023-10-22 14:50 ` [Bug c++/111919] " ppalka at gcc dot gnu.org
@ 2023-10-23 14:55 ` dcb314 at hotmail dot com
  2023-10-24 21:48 ` cvs-commit at gcc dot gnu.org
  2023-10-24 22:05 ` ppalka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: dcb314 at hotmail dot com @ 2023-10-23 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
Created attachment 56176
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56176&action=edit
partially reduced C++ source code

I have another test case.

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

* [Bug c++/111919] [14 Regression] ICE: tree check: did not expect class 'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144 on valid code
  2023-10-22  9:45 [Bug c++/111919] New: [14 Regression] ICE: tree check: did not expect class 'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144 on valid code zsojka at seznam dot cz
  2023-10-22 14:50 ` [Bug c++/111919] " ppalka at gcc dot gnu.org
  2023-10-23 14:55 ` dcb314 at hotmail dot com
@ 2023-10-24 21:48 ` cvs-commit at gcc dot gnu.org
  2023-10-24 22:05 ` ppalka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-10-24 21:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:51f164f76212feaf896d65616f60877d3217b701

commit r14-4898-g51f164f76212feaf896d65616f60877d3217b701
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Oct 24 17:48:00 2023 -0400

    c++: cp_stabilize_reference and non-dep exprs [PR111919]

    After the removal of NON_DEPENDENT_EXPR, cp_stabilize_reference (which
    used to just exit early for NON_DEPENDENT_EXPR) is now more prone to
    passing a weird templated tree to middle-end routines, which for the
    testcase below leads to a crash from contains_placeholder_p.  It seems
    the best fix is to just exit early when in a template context, like we
    do in the closely related function cp_save_expr.

            PR c++/111919

    gcc/cp/ChangeLog:

            * tree.cc (cp_stabilize_reference): Do nothing when
            processing_template_decl.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/non-dependent27.C: New test.

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

* [Bug c++/111919] [14 Regression] ICE: tree check: did not expect class 'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144 on valid code
  2023-10-22  9:45 [Bug c++/111919] New: [14 Regression] ICE: tree check: did not expect class 'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144 on valid code zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2023-10-24 21:48 ` cvs-commit at gcc dot gnu.org
@ 2023-10-24 22:05 ` ppalka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-10-24 22:05 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

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

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed, hopefully

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

end of thread, other threads:[~2023-10-24 22:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-22  9:45 [Bug c++/111919] New: [14 Regression] ICE: tree check: did not expect class 'type', have 'type' (integer_type) in contains_placeholder_p, at tree.cc:4144 on valid code zsojka at seznam dot cz
2023-10-22 14:50 ` [Bug c++/111919] " ppalka at gcc dot gnu.org
2023-10-23 14:55 ` dcb314 at hotmail dot com
2023-10-24 21:48 ` cvs-commit at gcc dot gnu.org
2023-10-24 22:05 ` ppalka 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).