diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f3e55e8592e22f428288ebb337fd46122ac8d789..c004870d5950c9f64fd3dc6f11a162f1a7667191 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-18  Tom de Vries  <tom@codesourcery.com>
+
+	PR target/45098
+	* tree-ssa-loop-ivopts.c (seq_cost): Fix call to rtx_cost.
+
 2011-05-18  Jakub Jelinek  <jakub@redhat.com>
 
 	PR tree-optimization/49000
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index b00b8d44ac38afc2466adb612c195b9c2d0c1a19..13c2b407cc2ff8a1434e6ee092cae8d0c9068e37 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -2745,7 +2745,7 @@ seq_cost (rtx seq, bool speed)
     {
       set = single_set (seq);
       if (set)
-	cost += rtx_cost (set, SET,speed);
+	cost += rtx_cost (SET_SRC (set), SET, speed);
       else
 	cost++;
     }