]> gcc.gnu.org Git - gcc.git/commit
tilegx: Fix infinite loop in gen-mul-tables generator
authorIain Buclaw <ibuclaw@gdcproject.org>
Wed, 22 Jun 2022 17:11:20 +0000 (19:11 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Fri, 24 Jun 2022 19:01:15 +0000 (21:01 +0200)
commita99706355ce51a464a2e74f81009b16a22f48691
tree59bdbff01c50778c0776b6c3deb166445ffb0921
parent6dd4d545617f094aa97566570bc1a04b73302a56
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.

(cherry picked from commit c0ad48527c314a1e9354b7c26718b56ed4abc92c)
gcc/config/tilepro/gen-mul-tables.cc
This page took 0.062484 seconds and 5 git commands to generate.