public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954
@ 2020-08-03 17:09 haoxintu at gmail dot com
  2020-08-03 19:26 ` [Bug c++/96442] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: haoxintu at gmail dot com @ 2020-08-03 17:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96442
           Summary: ICE in tree check: expected integer_type or
                    enumeral_type or boolean_type or real_type or
                    fixed_point_type, have record_type in int_fits_type_p,
                    at tree.c:8954
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Hi, all.

This code, reduced by C-Vise, makes GCC-trunk ICE and makes released GCC
versions "confused by early errors".

Input:
//small.cc
enum struct a : struct {};
template <class b> enum class a : class c{};
enum struct a {b};

Command:
g++ small.cc

Output:
small.cc:1:25: error: underlying type ‘<unnamed struct>’ of ‘a’ must be an
integral type
    1 | enum struct a : struct {};
      |                         ^
small.cc:3:13: error: different underlying type in enum ‘enum class a’
    3 | enum struct a {b};
      |             ^
small.cc:1:25: note: previous definition here
    1 | enum struct a : struct {};
      |                         ^
small.cc:3:16: internal compiler error: tree check: expected integer_type or
enumeral_type or boolean_type or real_type or fixed_point_type, have
record_type in int_fits_type_p, at tree.c:8954
    3 | enum struct a {b};
      |                ^
0x7c7fd7 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/tree.c:9687
0x7ceec0 tree_check5(tree_node const*, char const*, int, char const*,
tree_code, tree_code, tree_code, tree_code, tree_code)
        ../../gcc/tree.h:3650
0x7ceec0 int_fits_type_p(tree_node const*, tree_node const*)
        ../../gcc/tree.c:8954
0x919b9a build_enumerator(tree_node*, tree_node*, tree_node*, tree_node*,
unsigned int)
        ../../gcc/cp/decl.c:15906
0x9aafec cp_parser_enumerator_definition
        ../../gcc/cp/parser.c:19585
0x9aafec cp_parser_enumerator_list
        ../../gcc/cp/parser.c:19514
0x9aafec cp_parser_enum_specifier
        ../../gcc/cp/parser.c:19444
0x9aafec cp_parser_type_specifier
        ../../gcc/cp/parser.c:17769
0x9ab50e cp_parser_decl_specifier_seq
        ../../gcc/cp/parser.c:14436
0x9ac2c1 cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13690
0x9d763e cp_parser_declaration
        ../../gcc/cp/parser.c:13510
0x9d7d2b cp_parser_translation_unit
        ../../gcc/cp/parser.c:4793
0x9d7d2b c_parse_file()
        ../../gcc/cp/parser.c:44081
0xaf2e9d c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1188
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.

My gcc version is
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/haoxin/corpus-compilers/gcc-trunk/gcc-master/build/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure
--prefix=/home/haoxin/corpus-compilers/gcc-trunk/gcc-master/build/
--enable-languages=c,c++ CC=gcc CXX=g++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200801 (experimental) (GCC) 

Thanks,
Haoxin

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

* [Bug c++/96442] [9/10/11 Regression] ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954
  2020-08-03 17:09 [Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954 haoxintu at gmail dot com
@ 2020-08-03 19:26 ` mpolacek at gcc dot gnu.org
  2020-08-04  6:01 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-08-03 19:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.4
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
            Summary|ICE in tree check: expected |[9/10/11 Regression] ICE in
                   |integer_type or             |tree check: expected
                   |enumeral_type or            |integer_type or
                   |boolean_type or real_type   |enumeral_type or
                   |or fixed_point_type, have   |boolean_type or real_type
                   |record_type in              |or fixed_point_type, have
                   |int_fits_type_p, at         |record_type in
                   |tree.c:8954                 |int_fits_type_p, at
                   |                            |tree.c:8954
   Last reconfirmed|                            |2020-08-03
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed, started with r261655.

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

* [Bug c++/96442] [9/10/11 Regression] ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954
  2020-08-03 17:09 [Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954 haoxintu at gmail dot com
  2020-08-03 19:26 ` [Bug c++/96442] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
@ 2020-08-04  6:01 ` rguenth at gcc dot gnu.org
  2021-06-01  8:18 ` [Bug c++/96442] [9/10/11/12 " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-08-04  6:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

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

* [Bug c++/96442] [9/10/11/12 Regression] ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954
  2020-08-03 17:09 [Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954 haoxintu at gmail dot com
  2020-08-03 19:26 ` [Bug c++/96442] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
  2020-08-04  6:01 ` rguenth at gcc dot gnu.org
@ 2021-06-01  8:18 ` rguenth at gcc dot gnu.org
  2021-08-08  9:07 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 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] 9+ messages in thread

* [Bug c++/96442] [9/10/11/12 Regression] ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954
  2020-08-03 17:09 [Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954 haoxintu at gmail dot com
                   ` (2 preceding siblings ...)
  2021-06-01  8:18 ` [Bug c++/96442] [9/10/11/12 " rguenth at gcc dot gnu.org
@ 2021-08-08  9:07 ` pinskia at gcc dot gnu.org
  2022-02-22 12:22 ` roger at nextmovesoftware dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-08  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 95955 has been marked as a duplicate of this bug. ***

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

* [Bug c++/96442] [9/10/11/12 Regression] ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954
  2020-08-03 17:09 [Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954 haoxintu at gmail dot com
                   ` (3 preceding siblings ...)
  2021-08-08  9:07 ` pinskia at gcc dot gnu.org
@ 2022-02-22 12:22 ` roger at nextmovesoftware dot com
  2022-05-27  9:43 ` [Bug c++/96442] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-02-22 12:22 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

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

--- Comment #4 from Roger Sayle <roger at nextmovesoftware dot com> ---
Patch proposed.
https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590716.html

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

* [Bug c++/96442] [10/11/12/13 Regression] ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954
  2020-08-03 17:09 [Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954 haoxintu at gmail dot com
                   ` (4 preceding siblings ...)
  2022-02-22 12:22 ` roger at nextmovesoftware dot com
@ 2022-05-27  9:43 ` rguenth at gcc dot gnu.org
  2022-06-07  6:57 ` cvs-commit at gcc dot gnu.org
  2022-06-08 20:12 ` roger at nextmovesoftware dot com
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug c++/96442] [10/11/12/13 Regression] ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954
  2020-08-03 17:09 [Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954 haoxintu at gmail dot com
                   ` (5 preceding siblings ...)
  2022-05-27  9:43 ` [Bug c++/96442] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-07  6:57 ` cvs-commit at gcc dot gnu.org
  2022-06-08 20:12 ` roger at nextmovesoftware dot com
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-06-07  6:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:6dd194e2ce201d057e4faaecc36d19e0d3695f57

commit r13-999-g6dd194e2ce201d057e4faaecc36d19e0d3695f57
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Tue Jun 7 07:54:13 2022 +0100

    PR c++/96442: Improved error recovery in enumerations.

    This patch is a revised fix for PR c++/96442 providing a cleaner
    solution, setting ENUM_UNDERLYING_TYPE to integer_type_node when
    issuing an error, so that this invariant holds during the parser's
    error recovery.

    2022-06-07  Roger Sayle  <roger@nextmovesoftware.com>

    gcc/cp/ChangeLog
            PR c++/96442
            * decl.cc (start_enum): When emitting a "must be integral" error,
            set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
            downstream in build_enumeration.

    gcc/testsuite/ChangeLog
            PR c++/96442
            * g++.dg/parse/pr96442.C: New test case.

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

* [Bug c++/96442] [10/11/12/13 Regression] ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954
  2020-08-03 17:09 [Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954 haoxintu at gmail dot com
                   ` (6 preceding siblings ...)
  2022-06-07  6:57 ` cvs-commit at gcc dot gnu.org
@ 2022-06-08 20:12 ` roger at nextmovesoftware dot com
  7 siblings, 0 replies; 9+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-06-08 20:12 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|10.4                        |13.0

--- Comment #7 from Roger Sayle <roger at nextmovesoftware dot com> ---
This should now be fixed on mainline.

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

end of thread, other threads:[~2022-06-08 20:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03 17:09 [Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954 haoxintu at gmail dot com
2020-08-03 19:26 ` [Bug c++/96442] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
2020-08-04  6:01 ` rguenth at gcc dot gnu.org
2021-06-01  8:18 ` [Bug c++/96442] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-08-08  9:07 ` pinskia at gcc dot gnu.org
2022-02-22 12:22 ` roger at nextmovesoftware dot com
2022-05-27  9:43 ` [Bug c++/96442] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-07  6:57 ` cvs-commit at gcc dot gnu.org
2022-06-08 20:12 ` roger at nextmovesoftware dot com

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).