From 06ca573a159414a1c6efbae4964a105e06f95168 Mon Sep 17 00:00:00 2001 From: hpenner Date: Thu, 24 Jan 2002 12:30:37 +0000 Subject: [PATCH] * emit_rtl.c (gen_lowpart_common): Conversion from const_int to const_double needs to be done right for big-endian systems. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49180 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/emit-rtl.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 08bba7f..9bd5fe4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-01-14 Hartmut Penner + + * emit_rtl.c (gen_lowpart_common): Conversion from const_int + to const_double needs to be done right for big-endian systems. + 2002-01-24 Jason Merrill * config/sparc/sparc.md (call-jump peepholes): Pass the right insn diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index c3b8ddc..28e0dd9 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -919,13 +919,11 @@ gen_lowpart_common (mode, x) low = INTVAL (x), high = low >> (HOST_BITS_PER_WIDE_INT -1); else low = CONST_DOUBLE_LOW (x), high = CONST_DOUBLE_HIGH (x); - #ifdef HOST_WORDS_BIG_ENDIAN u.i[0] = high, u.i[1] = low; #else u.i[0] = low, u.i[1] = high; #endif - return CONST_DOUBLE_FROM_REAL_VALUE (u.d, mode); } @@ -1009,12 +1007,16 @@ gen_lowpart_common (mode, x) high = CONST_DOUBLE_HIGH (x); } +#if HOST_BITS_PER_WIDE_INT == 32 /* REAL_VALUE_TARGET_DOUBLE takes the addressing order of the target machine. */ if (WORDS_BIG_ENDIAN) i[0] = high, i[1] = low; else i[0] = low, i[1] = high; +#else + i[0] = low; +#endif r = REAL_VALUE_FROM_TARGET_DOUBLE (i); return CONST_DOUBLE_FROM_REAL_VALUE (r, mode); -- 2.7.4