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

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Confirmed.
>       else if (!fndecl_has_gimple_body_p (callee_fndecl)
>                && (!(callee_fndecl_flags & (ECF_CONST | ECF_PURE)))
>                && !fndecl_built_in_p (callee_fndecl))
>         unknown_side_effects = true;
> 
> The last part is part of the problem I think. At least here.

I think the problem is here, in the analyzer: I think the analyzer is here
making the assumption that builtins that haven't been explicitly handled don't
have side effects (such as writing through the input pointers), which is
clearly wrong for this builtin.


> Yes maybe we should have another builtin which returns a "_Complex unsigned
> long long" here which is folded into for __builtin_ia32_rdrand*_step to
> remove the need to the address too.
> 
> I am going to declare this one as a target issue but there might be other
> builtins which are harder to do the "_Complex" trick.

Andrew: I see you've marked this as a target missed-optimization bug, but
arguably there's still an analyzer bug here.  Should we reassign this back to
the analyzer, or perhaps make a clone of the bug so that we can cover the two
aspects of this separately?

Reply via email to