tree-optimization/111000 - restrict invariant motion of shifts
commitd118738e71cf4615f170fff8dabe66442206d008
authorRichard Biener <rguenther@suse.de>
Fri, 20 Oct 2023 09:54:07 +0000 (20 11:54 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 20 Oct 2023 11:19:55 +0000 (20 13:19 +0200)
tree427f8c6e40091ebd7fdd6807ab4348cac028632b
parent551935d11817dd5b139d66c36f62c0f0eba0db06
tree-optimization/111000 - restrict invariant motion of shifts

The following restricts moving variable shifts to when they are
always executed in the loop as we currently do not have an efficient
way to rewrite them to something that is unconditionally
well-defined and value range analysis will otherwise compute
invalid ranges for the shift operand.

PR tree-optimization/111000
* stor-layout.h (element_precision): Move ..
* tree.h (element_precision): .. here.
* tree-ssa-loop-im.cc (movement_possibility_1): Restrict
motion of shifts and rotates.

* gcc.dg/torture/pr111000.c: New testcase.
gcc/stor-layout.h
gcc/testsuite/gcc.dg/torture/pr111000.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.cc
gcc/tree.h