middle-end/103485 - fix conversion kind for vectors
authorRichard Biener <rguenther@suse.de>
Tue, 30 Nov 2021 07:19:24 +0000 (08:19 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 30 Nov 2021 08:16:41 +0000 (09:16 +0100)
commite2521cd2d26661cfcfceaabf9bd281ef316fd3fc
tree58bb7df30c2c5ca7adffce8dd88f78f8ea21cde3
parent930e7637828b6c6da7ff33ff3bd20c5c4c9164e7
middle-end/103485 - fix conversion kind for vectors

This makes sure to use a VIEW_CONVERT_EXPR for converting
vector signedness in the -((int)x >> (prec - 1)) to (unsigned)x >> (prec - 1)
simplification.

2021-11-30  Richard Biener  <rguenther@suse.de>

PR middle-end/103485
* match.pd (-((int)x >> (prec - 1)) to (unsigned)x >> (prec - 1)):
Use VIEW_CONVERT_EXPR for vectors.

* gcc.dg/pr103485.c: New testcase.
gcc/match.pd
gcc/testsuite/gcc.dg/pr103485.c [new file with mode: 0644]