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]

regrename: Fix for earlyclobber operands


I have a patch which makes use of the renamer more often, and this exposed a bug with earlyclobber operands. The code that does the terminate_write step has the following comment:

          /* Step 5: Close open chains that overlap writes.  Similar to
             step 2, we hide in-out operands, since we do not want to
             close these chains.  We also hide earlyclobber operands,
             since we've opened chains for them in step 1, and earlier
             chains they would overlap with must have been closed at
             the previous insn at the latest, as such operands cannot
             possibly overlap with any input operands.  */

That's all right as far as it goes, but the problem is that this means there isn't a terminate_write step for earlyclobbers.

The following seems like the simplest possible fix. It was bootstrapped and tested with -frename-registers enabled at -O1 on x86_64-linux. Ok?

(Incidentally there are some avx tests that fail if they are renamed, apparently because the scan-assembler doesn't allow register numbers like %zmm10. avx512bw-vptestmb-1.c is one of those).


Bernd
	* regrename.c (record_out_operands): Terminate earlyclobbered
	operands here.

Index: gcc/regrename.c
===================================================================
--- gcc/regrename.c	(revision 229049)
+++ gcc/regrename.c	(working copy)
@@ -1513,6 +1525,8 @@ record_out_operands (rtx_insn *insn, boo
 	cur_operand = insn_info->op_info + i;
 
       prev_open = open_chains;
+      if (earlyclobber)
+	scan_rtx (insn, loc, cl, terminate_write, OP_OUT);
       scan_rtx (insn, loc, cl, mark_write, OP_OUT);
 
       /* ??? Many targets have output constraints on the SET_DEST

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