[Bug tree-optimization/105150] [9/10/11/12 Regression] ICE with -Ofast: verify_gimple failed

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 5 09:21:19 GMT 2022


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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
So it's GENERIC folding and get_call_combined_fn as opposed to the GIMPLE
variant does not verify argument compatibility.  We have

 <call_expr 0x7ffff6524118
    type <real_type 0x7ffff653b348 double DF
        size <integer_cst 0x7ffff6517d50 constant 64>
        unit-size <integer_cst 0x7ffff6517d68 constant 8>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff653b348 precision:64
        pointer_to_this <pointer_type 0x7ffff653b930>>
    readonly
    fn <addr_expr 0x7ffff66652c0
        type <pointer_type 0x7ffff6650dc8 type <function_type 0x7ffff6650d20>
            unsigned DI size <integer_cst 0x7ffff6517d50 64> unit-size
<integer_cst 0x7ffff6517d68 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6650dc8>
        readonly constant
        arg:0 <function_decl 0x7ffff65b1700 sqrt type <function_type
0x7ffff6650b28>
            readonly addressable used nothrow public external built-in decl_3
decl_5 decl_6 QI defer-output t.c:5:1
            align:8 warn_if_not_align:0 built-in: BUILT_IN_NORMAL:BUILT_IN_SQRT
            attributes <tree_list 0x7ffff65afb18
                purpose <identifier_node 0x7ffff653fbe0 nothrow>
                chain <tree_list 0x7ffff65afaf0
                    purpose <identifier_node 0x7ffff653fc30 leaf>
                    chain <tree_list 0x7ffff65afac8
                        purpose <identifier_node 0x7ffff65322d0 const tree_0
                            rid 0x7ffff65322d0 "const">>>>>
        t.c:5:1 start: t.c:5:1 finish: t.c:5:1>
    arg:0 <integer_cst 0x7ffff6537108 type <integer_type 0x7ffff65335e8 int>
constant 1>

where the CALL_EXPR_FN is an ADDR_EXPR of pointer-to unprototyped
and the decl is unprototyped as well but it got BUILT_IN_NORMAL:BUILT_IN_SQRT
and the inherited attributes.  IMHO that's a frontend problem - it should
not do that.

There's nothing get_call_combined_fn can do here if we do not want to
resort to check against the actual built-in decl that is registered
via builtin_decl_explicit ().


More information about the Gcc-bugs mailing list