diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-11-17 00:22:16 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-11-17 00:22:16 +0100 |
commit | fb324f02097cf4175df7834104162199bddc4269 (patch) | |
tree | 72f534b97622655d109468e279fca8aefac13b32 /gcc/combine.c | |
parent | 8972f7e90b58d35906601e67c9c5e4b04f1a880e (diff) | |
download | gcc-fb324f02097cf4175df7834104162199bddc4269.zip gcc-fb324f02097cf4175df7834104162199bddc4269.tar.gz gcc-fb324f02097cf4175df7834104162199bddc4269.tar.bz2 |
re PR rtl-optimization/78378 (wrong code when combining shift + mult + zero_extend)
PR rtl-optimization/78378
* combine.c (make_extraction): Use force_to_mode for non-{REG,MEM}
inner only if pos is 0. Fix up formatting.
* gcc.c-torture/execute/pr78378.c: New test.
From-SVN: r242526
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index ca5ddae..5f920c4 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -7382,6 +7382,7 @@ make_extraction (machine_mode mode, rtx inner, HOST_WIDE_INT pos, if (tmode != BLKmode && ((pos_rtx == 0 && (pos % BITS_PER_WORD) == 0 && !MEM_P (inner) + && (pos == 0 || REG_P (inner)) && (inner_mode == tmode || !REG_P (inner) || TRULY_NOOP_TRUNCATION_MODES_P (tmode, inner_mode) @@ -7458,10 +7459,9 @@ make_extraction (machine_mode mode, rtx inner, HOST_WIDE_INT pos, } else new_rtx = force_to_mode (inner, tmode, - len >= HOST_BITS_PER_WIDE_INT - ? HOST_WIDE_INT_M1U - : (HOST_WIDE_INT_1U << len) - 1, - 0); + len >= HOST_BITS_PER_WIDE_INT + ? HOST_WIDE_INT_M1U + : (HOST_WIDE_INT_1U << len) - 1, 0); /* If this extraction is going into the destination of a SET, make a STRICT_LOW_PART unless we made a MEM. */ |