This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Combine simplify_set WORD_REGISTER_OPERATIONS
- From: Alan Modra <amodra at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Segher Boessenkool <segher at kernel dot crashing dot org>
- Date: Mon, 1 Feb 2016 08:46:42 +1030
- Subject: Combine simplify_set WORD_REGISTER_OPERATIONS
- Authentication-results: sourceware.org; auth=none
The comment says this test is supposed to prevent "a narrower
operation than requested", but it actually only allows a larger
subreg, not one the same size. Fix that.
Bootstrapped and regression tested powerpc64-linux. OK for stage1?
Note that this bug was found when investigating why gcc-6 does not
suffer from pr69548, ie. this bug was masking a powerpc backend bug.
* combine.c (simplify_set): Correct WORD_REGISTER_OPERATIONS test.
diff --git a/gcc/combine.c b/gcc/combine.c
index 858552d..9f284a7 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -6736,7 +6736,7 @@ simplify_set (rtx x)
+ (UNITS_PER_WORD - 1)) / UNITS_PER_WORD))
&& (WORD_REGISTER_OPERATIONS
|| (GET_MODE_SIZE (GET_MODE (src))
- < GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))))
+ <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))))
#ifdef CANNOT_CHANGE_MODE_CLASS
&& ! (REG_P (dest) && REGNO (dest) < FIRST_PSEUDO_REGISTER
&& REG_CANNOT_CHANGE_MODE_P (REGNO (dest),
--
Alan Modra
Australia Development Lab, IBM