This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch RFA] Handle blockage insn in mode-switching.c/create_pre_exit


Hi,

The mainline fails to build for sh4-unknown-linux-gnu during
the compilation of libgcc2.c:

../../../ORIG/trunk/libgcc/../gcc/libgcc2.c: In function '__divdi3':
../../../ORIG/trunk/libgcc/../gcc/libgcc2.c:1102: internal compiler error: in create_pre_exit, at mode-switching.c:352

It starts to fail after the patch

r122626 | aph | 2007-03-07 02:21:37 +0900 (Wed, 07 Mar 2007) | 6 lines

2007-03-06  Andrew Haley  <aph@redhat.com>

        * function.c (expand_function_end): Move blockage to just after we
        emit the label for the naked return from the function.

The function mode-switching.c/create_pre_exit scans insns from
the last to find the insns for return copy.  Now the last insns are

(insn 453 394 454 51 (set (reg:SI 0 r0 [ <result> ])
        (reg:SI 262 [ w ])) 172 {movsi_ie} (nil)
    (expr_list:REG_DEAD (reg:SI 262 [ w ])
        (nil)))

(insn 454 453 406 51 (set (reg:SI 1 r1 [ <result>+4 ])
        (reg:SI 263 [ w+4 ])) 172 {movsi_ie} (nil)
    (expr_list:REG_DEAD (reg:SI 263 [ w+4 ])
        (nil)))

(insn 406 454 407 51 (asm_input ("")) -1 (nil)
    (nil))

(insn 407 406 0 51 (use (reg/i:DI 0 r0 [ <result> ])) -1 (insn_list:REG_DEP_TRUE 453 (nil))
    (nil))

in the above failed case but create_pre_exit can't handle
the blockage insn.  The attached patch is to handle it and
fixes the build failure for sh4-unknown-linux-gnu.
It's tested with bootstrap and regtested with the top level
"make -k check" on i686-pc-linux-gnu with no new failures.

Regards,
	kaz
--
:ADDPATCH rtl-optimization:

2007-03-07  Kaz Kojima  <kkojima@gcc.gnu.org>

	* mode-switching.c (create_pre_exit): Skip blockage insn.

diff -uprN ORIG/trunk/gcc/mode-switching.c LOCAL/trunk/gcc/mode-switching.c
--- ORIG/trunk/gcc/mode-switching.c	2006-09-06 07:03:37.000000000 +0900
+++ LOCAL/trunk/gcc/mode-switching.c	2007-03-07 16:45:42.000000000 +0900
@@ -259,6 +259,11 @@ create_pre_exit (int n_entities, int *en
 			last_insn = return_copy;
 			continue;
 		      }
+		    if (GET_CODE (PATTERN (return_copy)) == ASM_INPUT)
+		      {
+			last_insn = return_copy;
+			continue;
+		      }
 		    /* If the return register is not (in its entirety)
 		       likely spilled, the return copy might be
 		       partially or completely optimized away.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]