From 1f9159112f9357490023cb19260a633aae5384fb Mon Sep 17 00:00:00 2001 From: uweigand Date: Mon, 9 Feb 2009 14:35:38 +0000 Subject: * config/spu/spu.c (array_to_constant): Fix (latent) wrong-code generation due to implicit sign extension. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144034 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/config/spu/spu.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1e2ae8b875..267badaa7c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-02-09 Ulrich Weigand + + * config/spu/spu.c (array_to_constant): Fix (latent) wrong-code + generation due to implicit sign extension. + 2009-02-09 Eric Botcazou PR middle-end/38981 diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index cd7f6edacb2..75f785393f9 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -4722,9 +4722,8 @@ array_to_constant (enum machine_mode mode, unsigned char arr[16]) } if (mode == DFmode) { - val = (arr[0] << 24) | (arr[1] << 16) | (arr[2] << 8) | arr[3]; - val <<= 32; - val |= (arr[4] << 24) | (arr[5] << 16) | (arr[6] << 8) | arr[7]; + for (i = 0, val = 0; i < 8; i++) + val = (val << 8) | arr[i]; return hwint_to_const_double (DFmode, val); } -- cgit v1.2.1