------- Comment #6 from siarhei dot siamashka at gmail dot com 2010-07-28 08:37 ------- 'arm_size_return_regs()' returns 2 when generating epilogue for 'next' function here. And as a result, return value not registered in the mask, causing it to be clobbered.
Would the following patch be the right fix? Index: gcc/config/arm/arm.c =================================================================== --- gcc/config/arm/arm.c (revision 162411) +++ gcc/config/arm/arm.c (working copy) @@ -13705,7 +13705,7 @@ && !crtl->tail_call_emit) { unsigned long mask; - mask = (1 << (arm_size_return_regs() / 4)) - 1; + mask = (1 << ((arm_size_return_regs() + 3) / 4)) - 1; mask ^= 0xf; mask &= ~saved_regs_mask; reg = 0; -- siarhei dot siamashka at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c++ |target http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45070