Fix PR tree-optimization/98272
commit61e3c180ad6913fa5af39059de5ba7b3bde50cda
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 16 Dec 2020 08:39:07 +0000 (16 09:39 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 16 Dec 2020 08:41:47 +0000 (16 09:41 +0100)
tree7f04e65fce1b54282a2c8160d02ebaa2951cb60e
parent31008a8bb30d8979bba5240be6b504140c5665ff
Fix PR tree-optimization/98272

This fixes the precision mismatch introduced by the previous change.

gcc/ChangeLog:
PR tree-optimization/98272
* tree-switch-conversion.c (bit_test_cluster::emit): When finding
out whether the entry test can be merged in the bit test, do the
computation using the type of the index expression.

gcc/testsuite/ChangeLog:
* gcc.dg/pr98272.c: New test.
gcc/testsuite/gcc.dg/pr98272.c [new file with mode: 0644]
gcc/tree-switch-conversion.c