Hi, > Pranav, although there is indeed a bug in the mid-end here, from your point > of view the simple and effective workaround should be to implement a movdi > pattern (and movsf and movdf if you don't have them yet: it's an absolute > requirement to implement movMM for any modes you expect your machine to > handle) in the backend. This won't fix the underlying bug, but it'll stop it > from affecting you, and you'll get better codegen all round into the bargain > if you expand movdi early.
It worked!!! I implemented the movsf pattern ( and also movdf so that the absence of a movdf also doesnt wont affect me in the future). Due to the movsf pattern, the return value is now restored with (insn 17 16 18 testcase-min.i:8 (set (reg:SF 139) (mem/c/i:SF (reg/f:SI 129 virtual-stack-vars) [2 S4 A32])) -1 (expr_list:REG_LIBCALL_ID (const_int 1 [0x1]) (insn_list:REG_RETVAL 14 (expr_list:REG_EQUAL (float:SF (reg:SI 138)) (nil))))) i.e. there is no subreg in the destination. Later in cse when the above REG_EQUAL (float:SF (reg:SI 138) note is converted into REG_EQUAL (const_double:SF 0 [0x0] 0.0 [0x0.0p+0] , It doesnt replace (subreg:SI (reg:SF 139) 0) in the insn (set (reg:SI 141) (xor:SI (subreg:SI (reg:SF 139) 0) (reg:SI 140))) 65 {xorsi3} (expr_list:REG_EQUAL (const_double:SF 0 [0x0] -0.0 [-0x0.0p+0]) (nil))) and the compiler doesnt crash :) Thanks Dave and Ian for your help!! cheers! Pranav