[Committed] PR middle-end/102029: Stricter typing in LSHIFT_EXPR sign folding.

Roger Sayle roger@nextmovesoftware.com
Tue Aug 24 02:00:29 GMT 2021


My sincere apologies to everyone (again).  As diagnosed by
Jakub Jelinek, my recent patch to fold the signedness of LSHIFT_EXPR
needs to be careful not to attempt transforming a left shift in an
integer type into an invalid left shift of a pointer type.

This patch has been committed as obvious, after testing that a
"make bootstrap" on x86_64-pc-linux-gnu is unaffected [make -k check
is underway].

Sorry (yet) again.


2021-08-23  Roger Sayle  <roger@nextmovesoftware.com>
	    Jakub Jelinek  <jakub@redhat.com>

gcc/ChangeLog
	PR middle-end/102029
	* match.pd (shift transformations): Add an additional check for
	!POINTER_TYPE_P in the recently added left shift transformation.

gcc/testsuite/ChangeLog
	PR middle-end/102029
	* gcc.dg/fold-convlshift-3.c: New test case.

Roger
--

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210824/ccf0b02d/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fold-convlshift-3.c
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210824/ccf0b02d/attachment.c>


More information about the Gcc-patches mailing list