Hi all, This ICE has a similar cause to PR 64600. The arm backend creates a const_int with a large value and doesn't properly sign-extend it. If that rtx then happens to pass through the simplify-rtx machinery and ends up in wide-int land the asserts there catch it and ICE. In this case it was 0x7fffffff having 1 added to it to make 0x80000000 which should have been sign-extended to 0xffffffff80000000. The code that caused this is: class G { public: void allocate(int p1) { if (p1 > max_size()) operator new(sizeof(short)); } unsigned max_size() { return -1 / sizeof(short); } }; but it also needs to go through simplify-rtx to ICE, so the testcase contains the context as well. Similarly, the solution here is to use ARM_SIGN_EXTEND on the SImode constants and trunc_int_for_mode for the DImode ones. Bootstrapped and tested on arm-none-linux-gnueabihf. Built SPEC2006 with it. No code changes anywhere except in one instruction where a: cmp r6, #2147483648 is transformed into a: cmp r6, #-2147483648 Both assemble to the same thing, the disassembly is: cmp.w r6, #2147483648 ; 0x80000000 Ok for trunk? Thanks, Kyrill 2015-04-09 Kyrylo Tkachov * config/arm/arm.c (arm_canonicalize_comparison): Use ARM_SIGN_EXTEND when creating +1 values for SImode and trunc_int_for_mode for similar DImode operations. 2015-04-09 Kyrylo Tkachov * g++.dg/torture/pr65694.C: New test.