From: Marek Polacek Date: Wed, 26 Mar 2014 06:46:27 +0000 (+0000) Subject: re PR other/59545 (Signed integer overflow issues) X-Git-Tag: releases/gcc-4.9.0~301 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6686e0bc1e8b83aed19f383b527bc67b5ba53480;p=thirdparty%2Fgcc.git re PR other/59545 (Signed integer overflow issues) PR other/59545 * ira-color.c (update_conflict_hard_regno_costs): Perform the multiplication in unsigned type. From-SVN: r208834 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc4ebfe38e6a..ee0df1c23e9b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-03-26 Marek Polacek + + PR other/59545 + * ira-color.c (update_conflict_hard_regno_costs): Perform the + multiplication in unsigned type. + 2014-03-26 Chung-Ju Wu * doc/install.texi: Document nds32le-*-elf and nds32be-*-elf. diff --git a/gcc/ira-color.c b/gcc/ira-color.c index c20aaf72dc60..1f4c96e9a897 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -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;