r254496 - in /trunk/gcc: ChangeLog match.pd tes...

wilco@gcc.gnu.org wilco@gcc.gnu.org
Tue Nov 7 12:23:00 GMT 2017


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.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.

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



More information about the Gcc-cvs mailing list