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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Wilco Dijkstra <wi...@gcc.gnu.org>:

https://gcc.gnu.org/g:bc071d3a951a98284a3f46043afd44c03c123376

commit r10-5986-gbc071d3a951a98284a3f46043afd44c03c123376
Author: Wilco Dijkstra <wdijk...@arm.com>
Date:   Wed Jan 15 15:23:54 2020 +0000

    Fix ctz issues (PR93231)

    Further improve the ctz recognition: Avoid ICEing on negative shift
    counts or multiply constants.  Check the type is a char type for the
    string constant case to avoid accidentally matching a wide STRING_CST.
    Add a tree_expr_nonzero_p check to allow the optimization even if
    CTZ_DEFINED_VALUE_AT_ZERO returns 0 or 1.  Add extra test cases.

    Bootstrap OK on AArch64 and x64.

        gcc/
        PR tree-optimization/93231
        * tree-ssa-forwprop.c (optimize_count_trailing_zeroes): Check
        input_type is unsigned.  Use tree_to_shwi for shift constant.
        Check CST_STRING element size is CHAR_TYPE_SIZE bits.
        (simplify_count_trailing_zeroes): Add test to handle known non-zero
        inputs more efficiently.

        testsuite/
        PR tree-optimization/93231
        * gcc.dg/pr90838.c: New test.
        * gcc.dg/pr93231.c: New test.
        * gcc.target/aarch64/pr90838.c: Use #define u 0.

Reply via email to