public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/115489] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589
@ 2024-06-14 10:53 iamanonymous.cs at gmail dot com
  2024-06-15  0:35 ` [Bug c/115489] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: iamanonymous.cs at gmail dot com @ 2024-06-14 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115489
           Summary: ICE: tree check: expected class 'type', have
                    'exceptional' (error_mark) in create_tmp_from_val, at
                    gimplify.cc:589
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
            Target: x86_64

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

*******************************************************************************
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
*******************************************************************************
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
*******************************************************************************
Program: Please refer to the attachment. 

*******************************************************************************
Command Lines:
# gcc bug892.c -O3 -Wall -Wextra -pedantic -fsanitize=address,undefined
-fstack-protector-strong -march=native -fvisibility=hidden -std=c17 -c -o
bug892.o


........................................
bug892.c: In function ‘func_64’:
bug892.c:347:17: internal compiler error: tree check: expected class ‘type’,
have ‘exceptional’ (error_mark) in create_tmp_from_val, at gimplify.cc:589
  347 | l_724[2][1] &=
(safe_rshift_func_int16_t_s_s((safe_mul_func_int16_t_s_s(l_705,
(safe_sub_func_uint64_t_u_u(8UL, (l_709 = ((*l_708) = 0L)))))),
(((safe_mul_func_uint16_t_u_u(((**g_601)++), (--(*l_714)))) &
(safe_sub_func_int16_t_s_s((&g_161 == (l_719 = (void*)0)), ((void*)0 !=
g_720)))) != (*g_135))));
      |               
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x8bbf2a tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /root/gdbtest/gcc/obj/../gcc/gcc/tree.cc:9045
0x7f33a6 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        /root/gdbtest/gcc/obj/../gcc/gcc/tree.h:3779
0x7f33a6 create_tmp_from_val
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:589
0x7f33a6 lookup_tmp_var
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:612
0xd68b1a internal_get_tmp_var
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:667
0xd6ecce get_initialized_tmp_var(tree_node*, gimple**, gimple**, bool)
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:711
0xd6ecce gimplify_save_expr
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:6817
0xd640dd gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:18188
0xd85c17 gimplify_stmt(tree_node**, gimple**)
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:7581
0xd85c17 gimplify_compound_expr
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:6766
0xd63f7b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:17877
0xd663a6 gimplify_stmt(tree_node**, gimple**)
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:7581
0xd64e33 gimplify_statement_list
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:2249
0xd64e33 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:18332
0xd663a6 gimplify_stmt(tree_node**, gimple**)
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:7581
0xd674a6 gimplify_bind_expr
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:1641
0xd64064 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:18088
0xd663a6 gimplify_stmt(tree_node**, gimple**)
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:7581
0xd64e33 gimplify_statement_list
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:2249
0xd64e33 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:18332
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.


*******************************************************************************

Also ICE on trunk, compiler explorer:https://godbolt.org/z/dq1xdovja

*******************************************************************************

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

* [Bug c/115489] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589
  2024-06-14 10:53 [Bug c/115489] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589 iamanonymous.cs at gmail dot com
@ 2024-06-15  0:35 ` pinskia at gcc dot gnu.org
  2024-06-15  0:45 ` sjames at gcc dot gnu.org
  2024-06-17 16:19 ` [Bug tree-optimization/115489] [12/13/14/15 regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589 since r12-3278-g823685221de986 roger at nextmovesoftware dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-15  0:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |pinskia at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |ice-checking
   Last reconfirmed|                            |2024-06-15

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
```
static int *g_161;
int f(int);
void func_64(int l_724) {
  l_724 &=  f (g_161);
}
static int g_161;
```

I suspect this started with r12-3278-g823685221de986 but since it does not ICE
with release checking I am not 100% there.

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

* [Bug c/115489] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589
  2024-06-14 10:53 [Bug c/115489] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589 iamanonymous.cs at gmail dot com
  2024-06-15  0:35 ` [Bug c/115489] " pinskia at gcc dot gnu.org
@ 2024-06-15  0:45 ` sjames at gcc dot gnu.org
  2024-06-17 16:19 ` [Bug tree-optimization/115489] [12/13/14/15 regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589 since r12-3278-g823685221de986 roger at nextmovesoftware dot com
  2 siblings, 0 replies; 4+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-06-15  0:45 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sjames at gcc dot gnu.org

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
Pretty sure you're right, as my checking 10+11 don't fail.

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

* [Bug tree-optimization/115489] [12/13/14/15 regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589 since r12-3278-g823685221de986
  2024-06-14 10:53 [Bug c/115489] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589 iamanonymous.cs at gmail dot com
  2024-06-15  0:35 ` [Bug c/115489] " pinskia at gcc dot gnu.org
  2024-06-15  0:45 ` sjames at gcc dot gnu.org
@ 2024-06-17 16:19 ` roger at nextmovesoftware dot com
  2 siblings, 0 replies; 4+ messages in thread
From: roger at nextmovesoftware dot com @ 2024-06-17 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |tree-optimization

--- Comment #3 from Roger Sayle <roger at nextmovesoftware dot com> ---
The call to gimplify_expr on line 651 of gimplify.cc (in internal_get_tmp_var)
doesn't check its return value, which for this test case is GS_ERROR.
It looks like internal_get_tmp_var's callers don't expect that it could ever
fail, so it's unclear whether returning NULL_RTX or error_mark_node would be
safe.
One approach might be to record the original type of val (which gets turned
into error_mark_node by the failing gimplify_expr call), then use this type to
call make_ssa_name if things have gone wrong [an uninitialized SSA name may
cause fewer downstream issues than an error_mark_node].

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

end of thread, other threads:[~2024-06-17 16:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-14 10:53 [Bug c/115489] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589 iamanonymous.cs at gmail dot com
2024-06-15  0:35 ` [Bug c/115489] " pinskia at gcc dot gnu.org
2024-06-15  0:45 ` sjames at gcc dot gnu.org
2024-06-17 16:19 ` [Bug tree-optimization/115489] [12/13/14/15 regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589 since r12-3278-g823685221de986 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).