[backport gcc-4.9/trunk r201598 ] List-Archive: Date: Thu, 08 Aug 2013 14:38:27 +0100 From: Richard Earnshaw Subject: [PATCH, ARM] Fix handling of function arguments with excess alignment PR target/56979 is a bug where a parameter to a function has an alignment that is larger than its natural alignment. In this case this causes the mid-end to generate a mode for the argument that is incompatible with the registers that are assigned for it. We then end up creating invalid RTL and subsequently abort when the pattern cannot emit assembly code. The fix is to decompose the assignment when this would happen in the same way that we handle other block mode arguments and handle each piece in turn. gcc/ 2013-08-08 Richard Earnshaw PR target/56979 * arm.c (aapcs_vfp_allocate): Decompose the argument if the suggested mode for the assignment isn't compatible with the registers required. --- gcc-4.8.1/gcc/config/arm/arm.c.~1~ 2013-05-24 17:15:44.000000000 +0200 +++ gcc-4.8.1/gcc/config/arm/arm.c 2013-08-10 12:11:21.714105153 +0200 @@ -4459,7 +4459,9 @@ aapcs_vfp_allocate (CUMULATIVE_ARGS *pcu if (((pcum->aapcs_vfp_regs_free >> regno) & mask) == mask) { pcum->aapcs_vfp_reg_alloc = mask << regno; - if (mode == BLKmode || (mode == TImode && !TARGET_NEON)) + if (mode == BLKmode + || (mode == TImode && ! TARGET_NEON) + || ! arm_hard_regno_mode_ok (FIRST_VFP_REGNUM + regno, mode)) { int i; int rcount = pcum->aapcs_vfp_rcount;