aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@gcc.gnu.org>2018-07-26 12:16:48 +0200
committerSegher Boessenkool <segher@gcc.gnu.org>2018-07-26 12:16:48 +0200
commit328aa7876732da9bbf851f7b9309b1f6fda1cd9d (patch)
treec7dcf974de0227370ede0f4f56a783a580a95da1
parent977667e6b74a56db3747caaed8ba776f6cae8cdf (diff)
downloadgcc-328aa7876732da9bbf851f7b9309b1f6fda1cd9d.zip
gcc-328aa7876732da9bbf851f7b9309b1f6fda1cd9d.tar.gz
gcc-328aa7876732da9bbf851f7b9309b1f6fda1cd9d.tar.bz2
combine: Another hard register problem (PR85805)
The current code in reg_nonzero_bits_for_combine allows using the reg_stat info when last_set_mode is a different integer mode. This is completely wrong for non-pseudos. For example, as in the PR, a value in a DImode hard register is set by eight writes to its constituent QImode parts. The value written to the DImode is not the same as that written to the lowest-numbered QImode! PR rtl-optimization/85805 * combine.c (reg_nonzero_bits_for_combine): Only use the last set value for hard registers if that was written in the same mode. From-SVN: r262994
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/combine.c3
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7a66a63..3518ecf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,8 +1,14 @@
+2018-07-26 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/85805
+ * combine.c (reg_nonzero_bits_for_combine): Only use the last set
+ value for hard registers if that was written in the same mode.
+
2018-07-26 Martin Liska <mliska@suse.cz>
- PR gcov-profile/86536
+ PR gcov-profile/86536
* gcov.c (format_gcov): Use printf format %.*f directly
- and do not handle special values.
+ and do not handle special values.
2018-07-25 Claudiu Zissulescu <claziss@synopsys.com>
diff --git a/gcc/combine.c b/gcc/combine.c
index cfe0f19..8f6db4f 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -10169,7 +10169,8 @@ reg_nonzero_bits_for_combine (const_rtx x, scalar_int_mode xmode,
rsp = &reg_stat[REGNO (x)];
if (rsp->last_set_value != 0
&& (rsp->last_set_mode == mode
- || (GET_MODE_CLASS (rsp->last_set_mode) == MODE_INT
+ || (REGNO (x) >= FIRST_PSEUDO_REGISTER
+ && GET_MODE_CLASS (rsp->last_set_mode) == MODE_INT
&& GET_MODE_CLASS (mode) == MODE_INT))
&& ((rsp->last_set_label >= label_tick_ebb_start
&& rsp->last_set_label < label_tick)