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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
This is a recurring problem.  I wonder how many more bugs like this there are. 
See for example below.  There ought to be a better way to prevent it than to
keep patching all the places in the middle end where the bad calls end up.

$ cat t.c && gcc -O2 -S -Wall t.c
void f (void)
{
  ((void (*)()) __builtin_free) ();
}
during RTL pass: expand
t.c: In function ‘f’:
t.c:3:4: internal compiler error: tree check: accessed operand 4 of call_expr
with 3 operands in maybe_emit_free_warning, at builtins.c:10608
    3 |   ((void (*)()) __builtin_free) ();
      |   ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x15b045d tree_operand_check_failed(int, tree_node const*, char const*, int,
char const*)
        /src/gcc/svn/gcc/tree.c:10059
0x827e8c tree_operand_check(tree_node*, int, char const*, int, char const*)
        /src/gcc/svn/gcc/tree.h:3676
0x9d4bdb maybe_emit_free_warning
        /src/gcc/svn/gcc/builtins.c:10608
0x9cc317 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
        /src/gcc/svn/gcc/builtins.c:8305
0xbf115c expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /src/gcc/svn/gcc/expr.c:11029
0xbe33e3 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
        /src/gcc/svn/gcc/expr.c:8274
0xa06252 expand_expr
        /src/gcc/svn/gcc/expr.h:279
0xa0f581 expand_call_stmt
        /src/gcc/svn/gcc/cfgexpand.c:2724
0xa12f29 expand_gimple_stmt_1
        /src/gcc/svn/gcc/cfgexpand.c:3691
0xa135e4 expand_gimple_stmt
        /src/gcc/svn/gcc/cfgexpand.c:3850
0xa136fc expand_gimple_tailcall
        /src/gcc/svn/gcc/cfgexpand.c:3897
0xa1bc7c expand_gimple_basic_block
        /src/gcc/svn/gcc/cfgexpand.c:5863
0xa1da9a execute
        /src/gcc/svn/gcc/cfgexpand.c:6509
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.

Reply via email to