diff mbox

rs6000: fix for PR61396 (wide-int fallout)

Message ID 29ef2867e3061b76859caa5725c1de44ea85aa52.1406003150.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool July 22, 2014, 4:43 a.m. UTC
CONSTANT_P is true for more than just all kinds of constant number.
This patch undoes that part of the wide-int patches.

Bootstrapped and tested on powerpc64-linux, -m64,-m32,-m32/-mpowerpc64.
No regressions (and the testcase mentioned in the PR is fixed, of course).

Okay to apply?


Segher


2014-07-21  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/
	PR target/61396
	* config/rs6000/rs6000.c (paired_expand_vector_init): Only allow
	constant numbers, not general constants.
	(rs6000_expand_vector_init): Ditto.

---
 gcc/config/rs6000/rs6000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mike Stump July 22, 2014, 9:04 a.m. UTC | #1
On Jul 21, 2014, at 9:43 PM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> CONSTANT_P is true for more than just all kinds of constant number.
> This patch undoes that part of the wide-int patches.

> Okay to apply?

Ok.

I’ve audited the rest of the wide-int patches to ensure that this was not repeated any place else, I didn’t find any other other than the two you found.  Thanks.
diff mbox

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 4547ae5..682fe42 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -5318,7 +5318,7 @@  paired_expand_vector_init (rtx target, rtx vals)
   for (i = 0; i < n_elts; ++i)
     {
       x = XVECEXP (vals, 0, i);
-      if (!CONSTANT_P (x))
+      if (!(CONST_SCALAR_INT_P (x) || CONST_DOUBLE_P (x) || CONST_FIXED_P (x)))
 	++n_var;
     }
   if (n_var == 0)
@@ -5470,7 +5470,7 @@  rs6000_expand_vector_init (rtx target, rtx vals)
   for (i = 0; i < n_elts; ++i)
     {
       x = XVECEXP (vals, 0, i);
-      if (!CONSTANT_P (x))
+      if (!(CONST_SCALAR_INT_P (x) || CONST_DOUBLE_P (x) || CONST_FIXED_P (x)))
 	++n_var, one_var = i;
       else if (x != CONST0_RTX (inner_mode))
 	all_const_zero = false;