Trivial:

src/gcc-4.5.0/gcc/config/alpha/alpha.c: In function ‘alpha_trampoline_init’:
/src/gcc-4.5.0/gcc/config/alpha/alpha.c:5580: warning: integer constant is too
large for ‘long’ type
/src/gcc-4.5.0/gcc/config/alpha/alpha.c:5591: warning: integer constant is too
large for ‘long’ type
/src/gcc-4.5.0/gcc/config/alpha/alpha.c:5592: warning: integer constant is too
large for ‘long’ type


jbook2:gcc jay$ diff -u /src/orig/gcc-4.5.0/gcc/config/alpha/alpha.c
/src/gcc-4.5.0/gcc/config/alpha/alpha.c
--- /src/orig/gcc-4.5.0/gcc/config/alpha/alpha.c        2010-04-02
12:54:46.000000000 -0700
+++ /src/gcc-4.5.0/gcc/config/alpha/alpha.c     2010-05-22 22:16:49.000000000
-0700
@@ -5577,7 +5577,7 @@
         the function's procedure descriptor with certain fields zeroed IAW
         the VMS calling standard. This is stored in the first quadword.  */
       word1 = force_reg (DImode, gen_const_mem (DImode, fnaddr));
-      word1 = expand_and (DImode, word1, GEN_INT (0xffff0fff0000fff0), NULL);
+      word1 = expand_and (DImode, word1, GEN_INT (0xffff0fff0000fff0LL),
NULL);
     }
   else
     {
@@ -5588,8 +5588,8 @@
            nop
         We don't bother setting the HINT field of the jump; the nop
         is merely there for padding.  */
-      word1 = GEN_INT (0xa77b0010a43b0018);
-      word2 = GEN_INT (0x47ff041f6bfb0000);
+      word1 = GEN_INT (0xa77b0010a43b0018LL);
+      word2 = GEN_INT (0x47ff041f6bfb0000LL);
     }

   /* Store the first two words, as computed above.  */
@@ -6642,7 +6642,6 @@
       }
 }


Though I do wonder if there is a more portable form,
like one for systems without a 64bit type or where "LL" isn't the extension.
(or for systems without long long but a 64bit long)


Like:
#if !(defined(_MSC_VER) || defined(__DEC))
#define __int64 long long
#define MAKE_INT64(x) x##LL
#define MAKE_UINT64(x) x##ULL
#else
#define MAKE_INT64(x) x##i64
#define MAKE_UINT64(x) x##ui64
#endif


or:

#if !(defined(_MSC_VER) || defined(__DEC))
#define __int64 long long
#endif
#define MAKE_INT64(hi, lo) ((((unsigned __int64)hi) << 32) | lo)


and yes I realize "long" might be 64bits, so there might be further
refinements.

#if !(defined(_MSC_VER) || defined(__DEC))
#ifdef _LP64
#define __int64 long
#define MAKE_INT64(x) x##L
#define MAKE_UINT64(x) x##UL
#else
#define __int64 long long
#define MAKE_INT64(x) x##LL
#define MAKE_UINT64(x) x##ULL
#endif
#else
#define MAKE_INT64(x) x##i64
#define MAKE_UINT64(x) x##ui64
#endif


or somesuch, but I tested assigning a long long to a long on Darwin/amd64
and no warning (even though in some "portable" sense, it should warn).
(I'll open a bug about that.)


 - Jay


-- 
           Summary: integer constant is too large for ‘long’ type in alpha.c
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jay dot krell at cornell dot edu
 GCC build triplet: i686-apple-darwin9
  GCC host triplet: alpha-dec-vms
GCC target triplet: alpha-dec-vms


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44251

Reply via email to