]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/110838 - less aggressively fold out-of-bound shifts
authorRichard Biener <rguenther@suse.de>
Fri, 4 Aug 2023 09:24:49 +0000 (11:24 +0200)
committerAndre Vieira <andre.simoesdiasvieira@arm.com>
Tue, 26 Mar 2024 15:05:05 +0000 (15:05 +0000)
commitd0eed43ff39a0bad4a02f8af7a4795e06aea6f80
tree0a79061fe8de4acd91e6b48e3bd2d4c730fd7858
parent1ddd9f9e53bd649d3d236f7941106d8cc46e7358
tree-optimization/110838 - less aggressively fold out-of-bound shifts

The following adjusts the shift simplification patterns to avoid
touching out-of-bound shift value arithmetic right shifts of
possibly negative values.  While simplifying those to zero isn't
wrong it's violating the principle of least surprise.

PR tree-optimization/110838
* match.pd (([rl]shift @0 out-of-bounds) -> zero): Restrict
the arithmetic right-shift case to non-negative operands.

(cherry picked from commit 04aa0edcace22a7815cfc57575f1f7b1f166ac10)
gcc/match.pd