aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-04-24 18:08:11 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-04-24 18:08:11 +0200
commit194ac52ab4a35f22abafaec46ac22ac303a61ab8 (patch)
treeca710a32b2afc2a6652c1ba80891b326e6c26420 /gcc/fold-const.c
parent9f9f72aa49dee36affe983b7791da8815a8125e3 (diff)
downloadgcc-194ac52ab4a35f22abafaec46ac22ac303a61ab8.zip
gcc-194ac52ab4a35f22abafaec46ac22ac303a61ab8.tar.gz
gcc-194ac52ab4a35f22abafaec46ac22ac303a61ab8.tar.bz2
re PR tree-optimization/36008 (Function produces wrong results when inlined.)
PR tree-optimization/36008 * fold-const.c (try_move_mult_to_index): If s == NULL, divide the original op1, rather than delta by step. * gcc.c-torture/execute/20080424-1.c: New test. From-SVN: r134634
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 4015f62..a4d5760 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -6919,7 +6919,7 @@ try_move_mult_to_index (tree addr, tree op1)
else
{
/* Try if delta is a multiple of step. */
- tree tmp = div_if_zero_remainder (EXACT_DIV_EXPR, delta, step);
+ tree tmp = div_if_zero_remainder (EXACT_DIV_EXPR, op1, step);
if (! tmp)
continue;
delta = tmp;