diff mbox

[1/5] rs6000: Fix PROMOTE_MODE for -m32 -mpowerpc64

Message ID a0366c6b956020e6762b6b78a73b20aba5ec1408.1421282067.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool Jan. 15, 2015, 1:14 a.m. UTC
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  <segher@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(-)

Comments

David Edelsohn Jan. 15, 2015, 4:36 a.m. UTC | #1
On Wed, Jan 14, 2015 at 8:14 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> 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  <segher@kernel.crashing.org>
>
> gcc/
>         * config/rs6000/rs6000.h (PROMOTE_MODE): Correct test for when -m32
>         -mpowerpc64 is active.

Okay.

Thanks, David
diff mbox

Patch

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