UNITS_PER_WORD is 8 with -m32 -mpowerpc64.  Promoting items smaller
than 8 bytes to 4 bytes doesn't make sense.

I tried to fix it the other way around first, promoting everything
smaller than UNITS_PER_WORD to word_mode; this fails all over the
place, because word_mode is bigger than Pmode.  So let's not do that ;-)

Okay for mainline?


Segher


2015-01-14  Segher Boessenkool  <seg...@kernel.crashing.org>

gcc/
        * config/rs6000/rs6000.h (PROMOTE_MODE): Correct test for when -m32
        -mpowerpc64 is active.

---
 gcc/config/rs6000/rs6000.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index c55d7ed..ef6bb2f 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -733,7 +733,7 @@ extern unsigned char rs6000_recip_bits[];
 
 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)      \
   if (GET_MODE_CLASS (MODE) == MODE_INT                \
-      && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
+      && GET_MODE_SIZE (MODE) < (TARGET_32BIT ? 4 : 8)) \
     (MODE) = TARGET_32BIT ? SImode : DImode;
 
 /* Define this if most significant bit is lowest numbered
-- 
1.8.1.4

Reply via email to