The function 'encode_arm_immediate' in tc-arm.c does not compile RTEMS 4.11 ARM GCC on OS X. The error reported is: ../../../../gcc-4.9.3/libgcc/config/arm/ieee754-df.S: Assembler messages: ../../../../gcc-4.9.3/libgcc/config/arm/ieee754-df.S:567: Error: invalid constant (ff) after fixup ../../../../gcc-4.9.3/libgcc/config/arm/ieee754-df.S:673: Error: invalid constant (ff) after fixup ../../../../gcc-4.9.3/libgcc/config/arm/ieee754-df.S:689: Error: invalid constant (fd) after fixup ../../../../gcc-4.9.3/libgcc/config/arm/ieee754-df.S:875: Error: invalid constant (ff) after fixup ../../../../gcc-4.9.3/libgcc/config/arm/ieee754-df.S:912: Error: invalid constant (fd) after fixup ../../../../gcc-4.9.3/libgcc/config/arm/ieee754-df.S:985: Error: invalid constant (fd) after fixup The error has been reported to Apple and they have have said the error is due to undefined behaviour in the function. A possible solution is: @@ -9,7 +9,7 @@ encode_arm_immediate (unsigned int val) printf("val = %08x\n", val); for (i = 0; i < 32; i += 2) - if ((a = (val << i | val >> (32 - i))) <= 0xff) + if ((a = (val << i | (i == 0 ? 0:val >> (32 - i)))) <= 0xff) return a | (i << 7); return (-1);
Fixed by d840c08. 2014-11-20 Richard Earnshaw <rearnsha@arm.com> * config/tc-arm.c (rotate_left): Avoid undefined behaviour when N = 0.