public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107978] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in dump_ada_declaration, at c-family/c-ada-spec.cc:2802 with -fdump-ada-spec
@ 2022-12-05 19:09 zsojka at seznam dot cz
  2022-12-05 19:26 ` [Bug c++/107978] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: zsojka at seznam dot cz @ 2022-12-05 19:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107978
           Summary: ICE: tree check: expected class 'type', have
                    'exceptional' (error_mark) in dump_ada_declaration, at
                    c-family/c-ada-spec.cc:2802 with -fdump-ada-spec
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-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 54020
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54020&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-g++ -fdump-ada-spec testcase.C 
testcase.C:1:10: error: aggregate 'S s' has incomplete type and cannot be
defined
    1 | struct S s;
      |          ^
testcase.C:1:11: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in dump_ada_declaration, at
c-family/c-ada-spec.cc:2802
    1 | struct S s;
      |           ^
0x8e5d3c tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /repo/gcc-trunk/gcc/tree.cc:8872
0x7810a7 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        /repo/gcc-trunk/gcc/tree.h:3651
0x7810a7 dump_ada_declaration
        /repo/gcc-trunk/gcc/c-family/c-ada-spec.cc:2802
0x1111629 dump_ada_nodes
        /repo/gcc-trunk/gcc/c-family/c-ada-spec.cc:826
0x1111629 dump_ads
        /repo/gcc-trunk/gcc/c-family/c-ada-spec.cc:3481
0x1111629 dump_ada_specs(void (*)(char const*), int (*)(tree_node*,
cpp_operation))
        /repo/gcc-trunk/gcc/c-family/c-ada-spec.cc:3560
0xed18e9 c_parse_final_cleanups()
        /repo/gcc-trunk/gcc/cp/decl2.cc:4919
0x10fb220 c_common_parse_file()
        /repo/gcc-trunk/gcc/c-family/c-opts.cc:1266
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.

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

* [Bug c++/107978] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in dump_ada_declaration, at c-family/c-ada-spec.cc:2802 with -fdump-ada-spec
  2022-12-05 19:09 [Bug c++/107978] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in dump_ada_declaration, at c-family/c-ada-spec.cc:2802 with -fdump-ada-spec zsojka at seznam dot cz
@ 2022-12-05 19:26 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-05 19:26 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-12-05

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
apinski@xeond:~/src/upstream-gcc/gcc/gcc/c-family$ git diff c-ada-spec.cc
diff --git a/gcc/c-family/c-ada-spec.cc b/gcc/c-family/c-ada-spec.cc
index faf71742522..2291638e9b3 100644
--- a/gcc/c-family/c-ada-spec.cc
+++ b/gcc/c-family/c-ada-spec.cc
@@ -3549,6 +3549,8 @@ void
 dump_ada_specs (void (*collect_all_refs)(const char *),
                int (*check)(tree, cpp_operation))
 {
+  if (seen_error ())
+    return;
   bitmap_obstack_initialize (NULL);

   overloaded_names = init_overloaded_names ();


Should fix this.

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

end of thread, other threads:[~2022-12-05 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-05 19:09 [Bug c++/107978] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in dump_ada_declaration, at c-family/c-ada-spec.cc:2802 with -fdump-ada-spec zsojka at seznam dot cz
2022-12-05 19:26 ` [Bug c++/107978] " pinskia 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).