tilegx: Fix infinite loop in gen-mul-tables generator
commitc0ad48527c314a1e9354b7c26718b56ed4abc92c
authorIain Buclaw <ibuclaw@gdcproject.org>
Wed, 22 Jun 2022 17:11:20 +0000 (22 19:11 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Fri, 24 Jun 2022 18:49:58 +0000 (24 20:49 +0200)
tree505100920ec9714013c52f1ee20dcb25ef6158e5
parentbb403de36aa29e5398119e78a2c96794bdd6bad8
tilegx: Fix infinite loop in gen-mul-tables generator

Since around GCC 10, the condition `j < (INTMAX_MAX / 10)' will get
optimized into `j != 922337203685477580', which will result in an
infinite loop for certain inputs of `j'.

Copy the condition already used by the -DTILEPRO generator code, which
doesn't fall into this trap.

gcc/ChangeLog:

* config/tilepro/gen-mul-tables.cc (tilegx_emit): Adjust loop
condition to avoid overflow.
gcc/config/tilepro/gen-mul-tables.cc