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

--- Comment #7 from Wilco <wilco at gcc dot gnu.org> ---
Author: wilco
Date: Tue Nov  7 12:23:38 2017
New Revision: 254496

URL: https://gcc.gnu.org/viewcvs?rev=254496&root=gcc&view=rev
Log:
PR80131: Simplification of 1U << (31 - x)

Currently the code A << (B - C) is not simplified.
However at least a more specific case of 1U << (C -x) where
C = precision(type) - 1 can be simplified to (1 << C) >> x.

This is done by adding a new simplification rule in match.pd.

2017-11-07  Sudakshina Das  <sudi....@arm.com>

    gcc/
        PR middle-end/80131
        * match.pd: Simplify 1 << (C - x) where C = precision (x) - 1.

    testsuite/
        PR middle-end/80131
        * testsuite/gcc.dg/pr80131-1.c: New Test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr80131-1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/match.pd
    trunk/gcc/testsuite/ChangeLog

Reply via email to