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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>:

https://gcc.gnu.org/g:53b86cac7e77ddff4e8a215408f7331ebc5bf22c

commit r15-3187-g53b86cac7e77ddff4e8a215408f7331ebc5bf22c
Author: Andrew Pinski <quic_apin...@quicinc.com>
Date:   Sun Aug 25 10:10:06 2024 -0700

    expand: Use the correct mode for store flags for popcount [PR116480]

    When expanding popcount used for equal to 1 (or rather
__builtin_stdc_has_single_bit),
    the wrong mode was bsing used for the mode of the store flags. We were
using the mode
    of the argument to popcount but since popcount's return value is always
int, the mode
    of the expansion here should have been the mode of the return type rater
than the argument.

    Built and tested on aarch64-linux-gnu with no regressions.
    Also bootstrapped and tested on x86_64-linux-gnu.

            PR middle-end/116480

    gcc/ChangeLog:

            * internal-fn.cc (expand_POPCOUNT): Use the correct mode
            for store flags.

    gcc/testsuite/ChangeLog:

            * gcc.dg/torture/pr116480-1.c: New test.
            * gcc.dg/torture/pr116480-2.c: New test.

    Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>

Reply via email to