public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [commit] reload: Fix PR 64010
@ 2014-12-03 22:03 Ulrich Weigand
  0 siblings, 0 replies; only message in thread
From: Ulrich Weigand @ 2014-12-03 22:03 UTC (permalink / raw)
  To: gcc-patches

Hello,

as discussed in the PR, this fixes a wrong-code reload bug in the
following situation in push_reload:

  /* If this is an input reload and the operand contains a register that
     dies in this insn and is used nowhere else, see if it is the right class
     to be used for this reload.  Use it if so.

The check "is used nowhere else" neglected to check for the possibility
that the current insn is a CALL_INSN and the register is used as argument
register in its CALL_INSN_FUNCTION_USAGE.

The patch below adds the missing check, fixing the PR.

Tested on x86_64-linux, committed to mainline.

Bye,
Ulrich


ChangeLog:

	PR rtl-optimization/64010
	* reload.c (push_reload): Before reusing a register contained
	in an operand as input reload register, ensure that it is not
	used in CALL_INSN_FUNCTION_USAGE.

Index: gcc/reload.c
===================================================================
--- gcc/reload.c	(revision 218272)
+++ gcc/reload.c	(working copy)
@@ -1625,6 +1625,7 @@ push_reload (rtx in, rtx out, rtx *inloc
 					       end_hard_regno (rel_mode,
 							       regno),
 					       PATTERN (this_insn), inloc)
+	    && ! find_reg_fusage (this_insn, USE, XEXP (note, 0))
 	    /* If this is also an output reload, IN cannot be used as
 	       the reload register if it is set in this insn unless IN
 	       is also OUT.  */
-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-03 22:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-03 22:03 [commit] reload: Fix PR 64010 Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).