summaryrefslogtreecommitdiff
path: root/gcc/loop-iv.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-06 02:15:30 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-06 02:15:30 +0000
commit701c3ea94860c878112a2357bf576cce476f5223 (patch)
treee42c3f93e644d6029160f633bc071200be69bcc7 /gcc/loop-iv.c
parenta04a7bec5afd7a0c4d7f32d84f7fa4832600ce70 (diff)
parent793f83aeb2332046c68f1ea901230f353610fe46 (diff)
downloadgcc-701c3ea94860c878112a2357bf576cce476f5223.tar.gz
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@204436 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-iv.c')
-rw-r--r--gcc/loop-iv.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 60d5043d67a..6b5f82b16b1 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -436,7 +436,9 @@ iv_subreg (struct rtx_iv *iv, enum machine_mode mode)
&& !iv->first_special)
{
rtx val = get_iv_value (iv, const0_rtx);
- val = lowpart_subreg (mode, val, iv->extend_mode);
+ val = lowpart_subreg (mode, val,
+ iv->extend == IV_UNKNOWN_EXTEND
+ ? iv->mode : iv->extend_mode);
iv->base = val;
iv->extend = IV_UNKNOWN_EXTEND;
@@ -476,8 +478,14 @@ iv_extend (struct rtx_iv *iv, enum iv_extend_code extend, enum machine_mode mode
&& !iv->first_special)
{
rtx val = get_iv_value (iv, const0_rtx);
+ if (iv->extend_mode != iv->mode
+ && iv->extend != IV_UNKNOWN_EXTEND
+ && iv->extend != extend)
+ val = lowpart_subreg (iv->mode, val, iv->extend_mode);
val = simplify_gen_unary (iv_extend_to_rtx_code (extend), mode,
- val, iv->extend_mode);
+ val,
+ iv->extend == extend
+ ? iv->extend_mode : iv->mode);
iv->base = val;
iv->extend = IV_UNKNOWN_EXTEND;
iv->mode = iv->extend_mode = mode;