NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/34549: amd64->sh3 cross compiler exposes gcc problem



The following reply was made to PR toolchain/34549; it has been noted by GNATS.

From: "Valeriy E. Ushakov" <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: toolchain/34549: amd64->sh3 cross compiler exposes gcc problem
Date: Fri, 18 Apr 2008 00:52:39 +0400

 The following patch fixes this issue.  Amd64 build tested by Joerg,
 resulted binaries tested by myself.  Native gcc (with this patch)
 cross-built from amd64 produces binaries identical to those produced
 by my native gcc cross-build from i386.
 
 Index: hwint.h
 ===================================================================
 RCS file: /cvsroot/src/gnu/dist/gcc4/gcc/hwint.h,v
 retrieving revision 1.1.1.1
 diff -u -r1.1.1.1 hwint.h
 --- hwint.h    20 Apr 2006 09:07:39 -0000      1.1.1.1
 +++ hwint.h    17 Apr 2008 01:59:09 -0000
 @@ -72,6 +72,7 @@
  #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
  # define HOST_WIDE_INT_PRINT "l"
  # define HOST_WIDE_INT_PRINT_C "L"
 +# define HOST_WIDE_INT_CONSTANT(x) x ## L
    /* 'long' might be 32 or 64 bits, and the number of leading zeroes
       must be tweaked accordingly.  */
  # if HOST_BITS_PER_WIDE_INT == 64
 @@ -82,6 +83,7 @@
  #else
  # define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT
  # define HOST_WIDE_INT_PRINT_C "LL"
 +# define HOST_WIDE_INT_CONSTANT(x) x ## LL
    /* We can assume that 'long long' is at least 64 bits.  */
  # define HOST_WIDE_INT_PRINT_DOUBLE_HEX \
      "0x%" HOST_LONG_LONG_FORMAT "x%016" HOST_LONG_LONG_FORMAT "x"
 Index: genemit.c
 ===================================================================
 RCS file: /cvsroot/src/gnu/dist/gcc4/gcc/genemit.c,v
 retrieving revision 1.1.1.1
 diff -u -r1.1.1.1 genemit.c
 --- genemit.c  20 Apr 2006 08:34:39 -0000      1.1.1.1
 +++ genemit.c  17 Apr 2008 01:59:09 -0000
 @@ -251,9 +251,9 @@
        printf ("const_true_rtx");
        else
        {
 -        printf ("GEN_INT (");
 -        printf (HOST_WIDE_INT_PRINT_DEC_C, INTVAL (x));
 -        printf (")");
 +        printf ("GEN_INT (HOST_WIDE_INT_CONSTANT (");
 +        printf (HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
 +        printf ("))");
        }
        return;
  
 Index: genrecog.c
 ===================================================================
 RCS file: /cvsroot/src/gnu/dist/gcc4/gcc/genrecog.c,v
 retrieving revision 1.1.1.1
 diff -u -r1.1.1.1 genrecog.c
 --- genrecog.c 20 Apr 2006 08:26:33 -0000      1.1.1.1
 +++ genrecog.c 17 Apr 2008 01:59:09 -0000
 @@ -1864,11 +1864,13 @@
  static void
  print_host_wide_int (HOST_WIDE_INT val)
  {
 +  /* XXX: the "min" below is computed for build, not host!!! */
    HOST_WIDE_INT min = (unsigned HOST_WIDE_INT)1 << (HOST_BITS_PER_WIDE_INT-1);
    if (val == min)
 -    printf ("(" HOST_WIDE_INT_PRINT_DEC_C "-1)", val + 1);
 +    printf ("(HOST_WIDE_INT_CONSTANT (" HOST_WIDE_INT_PRINT_DEC ")-1)",
 +          val + 1);
    else
 -    printf (HOST_WIDE_INT_PRINT_DEC_C, val);
 +    printf ("HOST_WIDE_INT_CONSTANT (" HOST_WIDE_INT_PRINT_DEC")", val);
  }
  
  /* Emit a switch statement, if possible, for an initial sequence of
 


Home | Main Index | Thread Index | Old Index