[committed] Fix EXECUTE_IF_SET_IN_HARD_REG_SET use
diff mbox series

Message ID mpt7e5hdgos.fsf@arm.com
State New
Headers show
  • [committed] Fix EXECUTE_IF_SET_IN_HARD_REG_SET use
Related show

Commit Message

Richard Sandiford Oct. 6, 2019, 3:41 p.m. UTC
As Maxim pointed out, r276309 broke -O3 bootstrap for aarch64-linux-gnu.
It turns out that EXECUTE_IF_SET_IN_HARD_REG_SET isn't safe to use for
temporary objects because their lifetimes don't extend to the end of
the loop.  This patch therefore uses an explicit temporary instead.

Other patches in the series already used this style (but for
full_reg_and_partial_clobbers rather than full_reg_clobbers),
so AFAICT this is the only place that needs fixing.

Tested on aarch64-linux-gnu, both with a normal bootstrap and
with bootstrap-O3.  Applied as obvious.


2019-10-06  Richard Sandiford  <richard.sandiford@arm.com>

	* var-tracking.c (dataflow_set_clear_at_call): Hoist temporary
	function result outside of EXECUTE_IF_SET_IN_HARD_REG_SET.

diff mbox series

Index: gcc/var-tracking.c
--- gcc/var-tracking.c	2019-09-30 17:19:45.051128625 +0100
+++ gcc/var-tracking.c	2019-10-06 16:35:52.453747845 +0100
@@ -4902,9 +4902,10 @@  dataflow_set_clear_at_call (dataflow_set
   unsigned int r;
   hard_reg_set_iterator hrsi;
-  function_abi callee_abi = insn_callee_abi (call_insn);
+  HARD_REG_SET callee_clobbers
+    = insn_callee_abi (call_insn).full_reg_clobbers ();
-  EXECUTE_IF_SET_IN_HARD_REG_SET (callee_abi.full_reg_clobbers (), 0, r, hrsi)
+  EXECUTE_IF_SET_IN_HARD_REG_SET (callee_clobbers, 0, r, hrsi)
     var_regno_delete (set, r);