On 6/23/21 2:37 PM, Richard Biener via Gcc-patches wrote:
On June 23, 2021 5:03:05 PM GMT+02:00, Aldy Hernandez via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
The call to gimple_call_fntype() in gimple_call_return_type() may
return
NULL, which causes the TREE_TYPE(lhs) to ICE. I think it would be best
to
return NULL (or void_type_node) rather than aborting.
I'm running into this because fold_using_range::range_of_call, calls
gimple_call_return_type which may ICE for builtins with no LHS.
Instead
of special casing things in range_of_call, perhaps it's best to plug
the
source.
Does this sound reasonable?
No, you need to make sure to not call this on an internal function call instead.
Otherwise it is never NULL.
Richard.
Out of curiosity, why is it not OK to call this on an internal function
call? Shouldn't all calls return something at least? like VOIDmode if
they don't return anything? It just seems like it needs to be special
cased either at any possible call site, or simply in the routine. we
stumbled across it and it wasn't obvious why.
Andrew