This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: f/target.c HOST_BYTES_BIG_ENDIAN


(gcc-patches@ added for archival purposes.)

On Fri, 23 Aug 2002, Alan Modra wrote:

> On Thu, Aug 22, 2002 at 10:32:07PM -0400, Hans-Peter Nilsson wrote:
> > Your patch is wrong; don't use the *target* BITS_BIG_ENDIAN (et
> > al) when the HOST_ one isn't defined.  I suggest to remove that
> > test; check instead that HOST_WORDS_BIG_ENDIAN matches both
> > BYTES_BIG_ENDIAN and WORDS_BIG_ENDIAN.
>
> Please, can you fix your code then?

Fair enough; here.  I've just sanity tested that this compiles
on a i686-pc-linux-gnu, with "make" on top of a previously
compiled tree.  Could you please test if it works for you?

	* target.c (ffetarget_memcpy_): Don't test nonexistent
	HOST_BYTES_BIG_ENDIAN, HOST_BITS_BIG_ENDIAN.  Check
	HOST_WORDS_BIG_ENDIAN against both WORDS_BIG_ENDIAN and
	BYTES_BIG_ENDIAN.  Check HOST_FLOAT_WORDS_BIG_ENDIAN against
	FLOAT_WORDS_BIG_ENDIAN.

Index: target.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/f/target.c,v
retrieving revision 1.19
diff -p -c -r1.19 target.c
*** target.c	17 Jun 2002 21:21:01 -0000	1.19
--- target.c	23 Aug 2002 20:30:19 -0000
*************** void *
*** 2521,2526 ****
--- 2521,2530 ----
  ffetarget_memcpy_ (void *dst, void *src, size_t len)
  {
  #ifdef CROSS_COMPILE
+
+   /* HOST_WORDS_BIG_ENDIAN corresponds to both WORDS_BIG_ENDIAN and
+      BYTES_BIG_ENDIAN (i.e. a difference in the two latter is not
+      representable on the host).  */
    int host_words_big_endian =
  #ifndef HOST_WORDS_BIG_ENDIAN
      0
*************** ffetarget_memcpy_ (void *dst, void *src,
*** 2529,2547 ****
  #endif
      ;

!   int host_bytes_big_endian =
! #ifndef HOST_BYTES_BIG_ENDIAN
!     0
! #else
!     HOST_BYTES_BIG_ENDIAN
! #endif
!     ;
!
!   int host_bits_big_endian =
! #ifndef HOST_BITS_BIG_ENDIAN
      0
  #else
!     HOST_BITS_BIG_ENDIAN
  #endif
      ;

--- 2533,2543 ----
  #endif
      ;

!   int host_float_words_big_endian =
! #ifndef HOST_FLOAT_WORDS_BIG_ENDIAN
      0
  #else
!     HOST_FLOAT_WORDS_BIG_ENDIAN
  #endif
      ;

*************** ffetarget_memcpy_ (void *dst, void *src,
*** 2555,2562 ****
       for instance in g77.f-torture/execute/980628-[4-6].f and alpha2.f.
       Still, we compile *some* code.  FIXME: Rewrite handling of numbers.  */
    if (!WORDS_BIG_ENDIAN != !host_words_big_endian
!       || !BYTES_BIG_ENDIAN != !host_bytes_big_endian
!       || !BITS_BIG_ENDIAN != !host_bits_big_endian)
      sorry ("data initializer on host with different endianness");

  #endif /* CROSS_COMPILE */
--- 2551,2558 ----
       for instance in g77.f-torture/execute/980628-[4-6].f and alpha2.f.
       Still, we compile *some* code.  FIXME: Rewrite handling of numbers.  */
    if (!WORDS_BIG_ENDIAN != !host_words_big_endian
!       || !BYTES_BIG_ENDIAN != !host_words_big_endian
!       || !FLOAT_WORDS_BIG_ENDIAN != !host_float_words_big_endian)
      sorry ("data initializer on host with different endianness");

  #endif /* CROSS_COMPILE */

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]