]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR80131: Simplification of 1U << (31 - x)
authorwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Nov 2017 12:23:38 +0000 (12:23 +0000)
committerwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Nov 2017 12:23:38 +0000 (12:23 +0000)
commita6eef1eda47dbc3a53cd00ac14bb74ca7332f4f2
tree42fa37718305129f4e755dba2412234ea69883f1
parent270a468f4bb24e6fd249e40acde0ef70c914f4ad
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.das@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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254496 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr80131-1.c [new file with mode: 0644]