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]

IA64 float extend splitters, take 2


The ia64 float extend splitters can still cause compiler crashes.  This happens
if they are the first insn in the function; in that case the variable LAST in
split_all_insns contains 0.

I've looked at try_split and its users a bit and I've come to the conclusion
that deleting insns with a splitter can't be made reliable - the callers
really expect it to return a new insn.  So I've changed the patterns in
ia64.md this time, along with a change in rest_of_compilation to run the
noop moves pass after doing these splits.


Bernd

	* config/ia64/ia64.md (extendsfdf2, extendsftf2, extenddftf2): Emit
	a no-op move if regs are equal.
	* toplev.c (rest_of_compilation): Do the noop moves elimination pass
	when calling jump after post-reload splitting.

Index: config/ia64/ia64.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/ia64.md,v
retrieving revision 1.52
diff -u -p -r1.52 ia64.md
--- ia64.md	2000/10/23 23:38:39	1.52
+++ ia64.md	2000/11/03 13:12:24
@@ -1072,7 +1071,14 @@
    getf.d %0 = %1"
   "reload_completed"
   [(set (match_dup 0) (float_extend:DF (match_dup 1)))]
-  "if (true_regnum (operands[0]) == true_regnum (operands[1])) DONE;"
+  "
+{
+  if (true_regnum (operands[0]) == true_regnum (operands[1]))
+    {
+      emit_insn (gen_movdi (pic_offset_table_rtx, pic_offset_table_rtx));
+      DONE;
+    }
+}"
   [(set_attr "type" "F,F,M,M,M,M")])
 
 (define_insn_and_split "extendsftf2"
@@ -1088,7 +1094,14 @@
    stfe %0 = %1%P0"
   "reload_completed"
   [(set (match_dup 0) (float_extend:TF (match_dup 1)))]
-  "if (true_regnum (operands[0]) == true_regnum (operands[1])) DONE;"
+  "
+{
+  if (true_regnum (operands[0]) == true_regnum (operands[1]))
+    {
+      emit_insn (gen_movdi (pic_offset_table_rtx, pic_offset_table_rtx));
+      DONE;
+    }
+}"
   [(set_attr "type" "F,F,M,M,M")])
 
 (define_insn_and_split "extenddftf2"
@@ -1104,7 +1117,14 @@
    stfe %0 = %1%P0"
   "reload_completed"
   [(set (match_dup 0) (float_extend:TF (match_dup 1)))]
-  "if (true_regnum (operands[0]) == true_regnum (operands[1])) DONE;"
+  "
+{
+  if (true_regnum (operands[0]) == true_regnum (operands[1]))
+    {
+      emit_insn (gen_movdi (pic_offset_table_rtx, pic_offset_table_rtx));
+      DONE;
+    }
+}"
   [(set_attr "type" "F,F,M,M,M")])
 
 (define_insn "truncdfsf2"
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.393
diff -u -p -r1.393 toplev.c
--- toplev.c	2000/10/31 10:09:34	1.393
+++ toplev.c	2000/11/03 13:12:26
@@ -3484,7 +3484,7 @@ rest_of_compilation (decl)
   open_dump_file (DFI_flow2, decl);
 
   jump_optimize (insns, !JUMP_CROSS_JUMP,
-		 !JUMP_NOOP_MOVES, !JUMP_AFTER_REGSCAN);
+		 JUMP_NOOP_MOVES, !JUMP_AFTER_REGSCAN);
   find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
 
   /* On some machines, the prologue and epilogue code, or parts thereof,


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