diff mbox

[PING] register CALL_INSN_FUNCTION_USAGE in find_all_hard_reg_sets

Message ID 5356DDB0.3020804@mentor.com
State New
Headers show

Commit Message

Tom de Vries April 22, 2014, 9:22 p.m. UTC
On 22-04-14 21:27, Eric Botcazou wrote:
>> Ping of this ( http://gcc.gnu.org/ml/gcc-patches/2014-01/msg00888.html )
>> patch.
>

Eric,

thanks for the review.

> That patch isn't for GCC mainline though, but

I don't understand why you say that.

> OK on principle if you test it
> on mainline,

I have.

> avoid the very ugly set-inside-use idiom and do:
>
>    record_hard_reg_sets (XEXP (op, 0), NULL, pset);
>
> instead of reimplementing it manually.
>

Updated as attached, I'll retest and commit.

Thanks,
- Tom

Comments

Eric Botcazou April 22, 2014, 10:03 p.m. UTC | #1
> I don't understand why you say that.

Because it cannot be applied on GCC mainline.
Tom de Vries April 23, 2014, 12:27 p.m. UTC | #2
On 23-04-14 00:03, Eric Botcazou wrote:
>> I don't understand why you say that.
>
> Because it cannot be applied on GCC mainline.
>

Eric,

Ah, I see.

Indeed, the patch is dependent on approved patch 'Add implicit parameter to 
find_all_hard_reg_sets' ( http://gcc.gnu.org/ml/gcc-patches/2013-03/msg01317.html ).

Thanks,
- Tom
diff mbox

Patch

2014-01-15  Tom de Vries  <tom@codesourcery.com>

	* rtlanal.c (find_all_hard_reg_sets): Note INSN_CALL_FUNCTION_USAGE
	clobbers.

diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 284c475..f3471b1 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1052,8 +1052,14 @@  find_all_hard_reg_sets (const_rtx insn, HARD_REG_SET *pset, bool implicit)
 
   CLEAR_HARD_REG_SET (*pset);
   note_stores (PATTERN (insn), record_hard_reg_sets, pset);
-  if (implicit && CALL_P (insn))
-    IOR_HARD_REG_SET (*pset, call_used_reg_set);
+  if (CALL_P (insn))
+    {
+      if (implicit)
+	IOR_HARD_REG_SET (*pset, call_used_reg_set);
+
+      for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))
+	record_hard_reg_sets (XEXP (link, 0), NULL, pset);
+    }
   for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
     if (REG_NOTE_KIND (link) == REG_INC)
       record_hard_reg_sets (XEXP (link, 0), NULL, pset);