https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115290
Bug ID: 115290 Summary: tree check fail in c_tree_printer, at c/c-objc-common.cc:330 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- For this C code: $ more bug1029.c typedef enum { SERVER_HELLO_DONE } message_type_t; message_type_t handshakes[256][32], tls13_handshakes[256][32]; void main() { (0 ? tls13_handshakes : handshakes) == tls13_handshakes; } $ compiled as follows: $ ~/gcc/results/bin/gcc -c -Wall bug1029.c does this: bug1029.c:3:6: warning: return type of ‘main’ is not ‘int’ [-Wmain] 3 | void main() { (0 ? tls13_handshakes : handshakes) == tls13_handshakes; } | ^~~~ bug1029.c: In function ‘main’: bug1029.c:3:51: warning: comparison between two arrays [-Warray-compare] 3 | void main() { (0 ? tls13_handshakes : handshakes) == tls13_handshakes; } | ^~ tree check: expected tree that contains ‘decl minimal’ structure, have ‘cond_exp r’ in c_tree_printer, at c/c-objc-common.cc:330 3 | void main() { (0 ? tls13_handshakes : handshakes) == tls13_handshakes; } | ^~~~ 0x81bb1e tree_contains_struct_check_failed(tree_node const*, tree_node_structure _enum, char const*, int, char const*) ../../trunk.20210101/gcc/tree.cc:9169 0x6e18a8 contains_struct_check(tree_node*, tree_node_structure_enum, char const* , int, char const*) ../../trunk.20210101/gcc/tree.h:3770 0x6e18a8 c_tree_printer ../../trunk.20210101/gcc/c/c-objc-common.cc:330 The bug first appeared sometime before git hash 28b508233a12c132.