From patchwork Mon Nov 5 22:58:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFA,middle-end] Fix PR target/41993 Date: Mon, 05 Nov 2012 12:58:13 -0000 From: Kaz Kojima X-Patchwork-Id: 197356 Message-Id: <20121106.075813.150568568.kkojima@rr.iij4u.or.jp> To: gcc-patches@gcc.gnu.org Cc: ubizjak@gmail.com Hi, The attached patch is to solve PR target/41993 which will affect targets using MODE_EXIT. Without it, we can't find all return registers for __builtin_return in mode-switching.c:create_pre_exit. See the trail #4 by Uros in the PR for the details. The patch is tested with bootstrap and regtested on i686-pc-linux-gnu with no new failures. It's also tested on cross sh4-unknown-linux-gnu. OK for trunk? Regards, kaz --- 2012-11-05 Uros Bizjak Kaz Kojima PR target/41993 * mode-switching.c (create_pre_exit): Set return_copy to last_insn when copy_start is a pseudo reg. --- ORIG/trunk/gcc/mode-switching.c 2012-11-05 08:07:55.000000000 +0900 +++ trunk/gcc/mode-switching.c 2012-11-05 19:22:56.000000000 +0900 @@ -324,7 +324,10 @@ create_pre_exit (int n_entities, int *en else break; if (copy_start >= FIRST_PSEUDO_REGISTER) - break; + { + last_insn = return_copy; + continue; + } copy_num = hard_regno_nregs[copy_start][GET_MODE (copy_reg)];