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]

Variable LONG_TYPE_SIZE and MAX_LONG_TYPE_SIZE


On mips, LONG_TYPE_SIZE and MAX_LONG_TYPE_SIZE are defined as

#define LONG_TYPE_SIZE (TARGET_LONG64 ? 64 : 32)
#define MAX_LONG_TYPE_SIZE 64

As the result, HOST_WIDE_INT is defined as "long long" when configured
for a mips target. For the 32bit mips target, I got the preprocessed
code like:

typedef unsigned int hashval_t;
....
static hashval_t
t2r_hash (pentry)
     const void * pentry; 
{
  tree entry = (tree) pentry; 
  return ((long long) (((entry)->list.purpose)) & 0777777);
}

and the compiler warnings enclosed here. Apparently, we have to define
MAX_LONG_TYPE_SIZE as a constant. What is the best way to fix it? I
think for mips, we should define MAX_LONG_TYPE_SIZE according to the
target, 32bit or 64bit. I think we should use target_cpu_default to
deal with it. Should I submit a patch?



H.J.
----
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/except.c:1492: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/except.c:1519: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/except.c:1534: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/except.c:1568: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/except.c:1598: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/except.c:1613: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/decl.c:827: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/decl.c:1282: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/decl.c:1283: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/decl.c:1708: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/decl.c:1709: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/decl.c:14171: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/decl.c:14172: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/tree.c:445: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/tree.c:445: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/tree.c:711: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/tree.c:714: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/cp/tree.c:718: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/objc/objc-act.c:5506: warning: cast from pointer to integer of different size
/home/hjl/work/gnu/src/gcc/gcc-dwarf/gcc/objc/objc-act.c:5529: warning: cast from pointer to integer of different size


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