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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pan Li <pa...@gcc.gnu.org>:

https://gcc.gnu.org/g:905973410957891fec8a3e42eeefa4618780e0ce

commit r15-2241-g905973410957891fec8a3e42eeefa4618780e0ce
Author: Pan Li <pan2...@intel.com>
Date:   Thu Jul 18 17:23:36 2024 +0800

    Internal-fn: Only allow modes describe types for internal fn[PR115961]

    The direct_internal_fn_supported_p has no restrictions for the type
    modes.  For example the bitfield like below will be recog as .SAT_TRUNC.

    struct e
    {
      unsigned pre : 12;
      unsigned a : 4;
    };

    __attribute__((noipa))
    void bug (e * v, unsigned def, unsigned use) {
      e & defE = *v;
      defE.a = min_u (use + 1, 0xf);
    }

    This patch would like to add checks for the direct_internal_fn_supported_p,
    and only allows the tree types describled by modes.

    The below test suites are passed for this patch:
    1. The rv64gcv fully regression tests.
    2. The x86 bootstrap tests.
    3. The x86 fully regression tests.

            PR target/115961

    gcc/ChangeLog:

            * internal-fn.cc (type_strictly_matches_mode_p): Add new func
            impl to check type strictly matches mode or not.
            (type_pair_strictly_matches_mode_p): Ditto but for tree type
            pair.
            (direct_internal_fn_supported_p): Add above check for the tree
            type pair.

    gcc/testsuite/ChangeLog:

            * g++.dg/torture/pr115961-run-1.C: New test.

    Signed-off-by: Pan Li <pan2...@intel.com>

Reply via email to