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

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Jambor <[email protected]>:

https://gcc.gnu.org/g:946580776e85db57b914c0a883f455caaa59b92d

commit r16-6782-g946580776e85db57b914c0a883f455caaa59b92d
Author: Martin Jambor <[email protected]>
Date:   Wed Jan 14 20:41:57 2026 +0100

    ipa-cp: Always return the right type in ipa_value_from_jfunc (PR123542)

    PR 123542 is about triggering a checking assert that verifies that we
    indeed clone a function for the constant value we started evaluating.
    The issue is that we get a double 2 instead of a float 2 which comes
    down to function ipa_value_from_jfunc not doing the necessary
    conversion when dealing directly with constants (and ancestor jump
    functions but that is very unlikley to cause problems).

    This patch makes sure the required conversion is performed in all
    cases (even for the ancestor JFs) and checks that the result type is
    known, because when the function is invoked from ipa-modref.cc or
    ipa-fnsummary.cc that may not be the case.

    gcc/ChangeLog:

    2026-01-14  Martin Jambor  <[email protected]>

            PR ipa/123542
            * ipa-cp.cc (ipa_value_from_jfunc): Always use
            ipacp_value_safe_for_type.  Bail out if parm_type is NULL.

    gcc/testsuite/ChangeLog:

    2026-01-14  Martin Jambor  <[email protected]>

            PR ipa/123542
            * gcc.dg/ipa/pr123542.c: New test.

Reply via email to