[PATCH GCC]Simplify (convert)(X op const) -> (convert)X op (convert)const by match&simplify

Bin Cheng Bin.Cheng@arm.com
Tue Oct 11 15:03:00 GMT 2016


Hi,
We missed folding (convert)(X op const) -> (convert)X op (convert)const for unsigned narrowing because of reason reported at https://gcc.gnu.org/ml/gcc/2016-07/msg00126.html
This patch fixes the issue by adding new match&simplify pattern, it also adds a test case.  This is the prerequisite patch for next patch adding new vectorization pattern.

Bootstrap and test along with the next patch on x86_64 and AArch64.  Is it OK?

Thanks,
bin

2016-10-11  Bin Cheng  <bin.cheng@arm.com>

	* match.pd ((convert (X op C))): Fold type narrowing for unsigned
	operation on constant.

gcc/testsuite/ChangeLog
2016-10-11  Bin Cheng  <bin.cheng@arm.com>

	* gcc.dg/fold-narrow-unsgn-opcst.c: New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: simplify-narrow-unsigned-opcst-20160922.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161011/13e70646/attachment.txt>


More information about the Gcc-patches mailing list