]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR other/59545 (Signed integer overflow issues)
authorMarek Polacek <polacek@redhat.com>
Wed, 26 Mar 2014 06:46:27 +0000 (06:46 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 26 Mar 2014 06:46:27 +0000 (06:46 +0000)
PR other/59545
* ira-color.c (update_conflict_hard_regno_costs): Perform the
multiplication in unsigned type.

From-SVN: r208834

gcc/ChangeLog
gcc/ira-color.c

index dc4ebfe38e6af81c09d1c574751b833f06dd03a4..ee0df1c23e9bb9e09140651f18b256fb9c8daf69 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-26  Marek Polacek  <polacek@redhat.com>
+
+       PR other/59545
+       * ira-color.c (update_conflict_hard_regno_costs): Perform the
+       multiplication in unsigned type.
+
 2014-03-26  Chung-Ju Wu  <jasonwucj@gmail.com>
 
        * doc/install.texi: Document nds32le-*-elf and nds32be-*-elf.
index c20aaf72dc6097bffb81c89b948d67125198b146..1f4c96e9a8971c1871fb40b2195bac9165e3b13c 100644 (file)
@@ -1505,7 +1505,7 @@ update_conflict_hard_regno_costs (int *costs, enum reg_class aclass,
                index = ira_class_hard_reg_index[aclass][hard_regno];
                if (index < 0)
                  continue;
-               cost = conflict_costs [i] * mult / div;
+               cost = (int) ((unsigned) conflict_costs [i] * mult) / div;
                if (cost == 0)
                  continue;
                cont_p = true;