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

           Summary: frv-elf --enable-werror-always build fails for 64 bit
                    host
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: amyl...@gcc.gnu.org
            Blocks: 44756
              Host: x86_64-linux-gnu
            Target: frv-*-*


../../../gcc/gcc/config/frv/predicates.md: In function
‘integer_register_operand_1’:
../../../gcc/gcc/config/frv/predicates.md:39:3: error: comparison is always
true due to limited range of data type [-Werror=type-limits]
../../../gcc/gcc/config/frv/predicates.md: In function
‘gpr_no_subreg_operand_1’:
../../../gcc/gcc/config/frv/predicates.md:76:3: error: comparison is always
true due to limited range of data type [-Werror=type-limits]
../../../gcc/gcc/config/frv/predicates.md: In function
‘gpr_or_int12_operand_1’:
../../../gcc/gcc/config/frv/predicates.md:132:3: error: comparison is always
true due to limited range of data type [-Werror=type-limits]
../../../gcc/gcc/config/frv/predicates.md: In function
‘gpr_or_int10_operand_1’:
../../../gcc/gcc/config/frv/predicates.md:189:3: error: comparison is always
true due to limited range of data type [-Werror=type-limits]
../../../gcc/gcc/config/frv/predicates.md: In function ‘gpr_or_int_operand_1’:
../../../gcc/gcc/config/frv/predicates.md:214:3: error: comparison is always
true due to limited range of data type [-Werror=type-limits]

REGNO yields an "unsigned" value, and this is tested with GPR_OR_PSEUDO_P.
The latter checks GPR_P, which in turn checks
IN_RANGE_P (R, GPR_FIRST, GPR_LAST) .

GPR_FIRST is #defined as 0.

IN_RANGE is defined like this:
#define IN_RANGE_P(VALUE, LOW, HIGH)                            \
  (   (((HOST_WIDE_INT)(VALUE)) >= (HOST_WIDE_INT)(LOW))        \
   && (((HOST_WIDE_INT)(VALUE)) <= ((HOST_WIDE_INT)(HIGH))))

on an ILP32 bit host, this means that the "unsigned" value from REGNO gets
casted to "int", thus the compiler does not know about the comparison result.

on a host with 32 bit unsigned and 64 bit long, however, the comparison is
always true.

Reply via email to