diff mbox series

[044/nnn] poly_int: push_block/emit_push_insn

Message ID 87lgk1n5o6.fsf@linaro.org
State New
Headers show
Series [044/nnn] poly_int: push_block/emit_push_insn | expand

Commit Message

Richard Sandiford Oct. 23, 2017, 5:19 p.m. UTC
This patch changes the "extra" parameters to push_block and
emit_push_insn from int to poly_int64.


2017-10-23  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* expr.h (push_block, emit_push_insn): Change the "extra" parameter
	from HOST_WIDE_INT to poly_int64.
	* expr.c (push_block, emit_push_insn): Likewise.

Comments

Jeff Law Nov. 28, 2017, 9:11 p.m. UTC | #1
On 10/23/2017 11:19 AM, Richard Sandiford wrote:
> This patch changes the "extra" parameters to push_block and
> emit_push_insn from int to poly_int64.
> 
> 
> 2017-10-23  Richard Sandiford  <richard.sandiford@linaro.org>
> 	    Alan Hayward  <alan.hayward@arm.com>
> 	    David Sherwood  <david.sherwood@arm.com>
> 
> gcc/
> 	* expr.h (push_block, emit_push_insn): Change the "extra" parameter
> 	from HOST_WIDE_INT to poly_int64.
> 	* expr.c (push_block, emit_push_insn): Likewise.
OK.
jeff
diff mbox series

Patch

Index: gcc/expr.h
===================================================================
--- gcc/expr.h	2017-10-23 17:18:43.842393134 +0100
+++ gcc/expr.h	2017-10-23 17:18:56.434286222 +0100
@@ -233,11 +233,11 @@  extern rtx emit_move_resolve_push (machi
 
 /* Push a block of length SIZE (perhaps variable)
    and return an rtx to address the beginning of the block.  */
-extern rtx push_block (rtx, int, int);
+extern rtx push_block (rtx, poly_int64, int);
 
 /* Generate code to push something onto the stack, given its mode and type.  */
 extern bool emit_push_insn (rtx, machine_mode, tree, rtx, unsigned int,
-			    int, rtx, int, rtx, rtx, int, rtx, bool);
+			    int, rtx, poly_int64, rtx, rtx, int, rtx, bool);
 
 /* Extract the accessible bit-range from a COMPONENT_REF.  */
 extern void get_bit_range (poly_uint64_pod *, poly_uint64_pod *, tree,
Index: gcc/expr.c
===================================================================
--- gcc/expr.c	2017-10-23 17:18:47.661057448 +0100
+++ gcc/expr.c	2017-10-23 17:18:56.434286222 +0100
@@ -3865,19 +3865,19 @@  compress_float_constant (rtx x, rtx y)
    otherwise, the padding comes at high addresses.  */
 
 rtx
-push_block (rtx size, int extra, int below)
+push_block (rtx size, poly_int64 extra, int below)
 {
   rtx temp;
 
   size = convert_modes (Pmode, ptr_mode, size, 1);
   if (CONSTANT_P (size))
     anti_adjust_stack (plus_constant (Pmode, size, extra));
-  else if (REG_P (size) && extra == 0)
+  else if (REG_P (size) && known_zero (extra))
     anti_adjust_stack (size);
   else
     {
       temp = copy_to_mode_reg (Pmode, size);
-      if (extra != 0)
+      if (maybe_nonzero (extra))
 	temp = expand_binop (Pmode, add_optab, temp,
 			     gen_int_mode (extra, Pmode),
 			     temp, 0, OPTAB_LIB_WIDEN);
@@ -3887,7 +3887,7 @@  push_block (rtx size, int extra, int bel
   if (STACK_GROWS_DOWNWARD)
     {
       temp = virtual_outgoing_args_rtx;
-      if (extra != 0 && below)
+      if (maybe_nonzero (extra) && below)
 	temp = plus_constant (Pmode, temp, extra);
     }
   else
@@ -3895,7 +3895,7 @@  push_block (rtx size, int extra, int bel
       if (CONST_INT_P (size))
 	temp = plus_constant (Pmode, virtual_outgoing_args_rtx,
 			      -INTVAL (size) - (below ? 0 : extra));
-      else if (extra != 0 && !below)
+      else if (maybe_nonzero (extra) && !below)
 	temp = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx,
 			     negate_rtx (Pmode, plus_constant (Pmode, size,
 							       extra)));
@@ -4269,7 +4269,7 @@  memory_load_overlap (rtx x, rtx y, HOST_
 
 bool
 emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
-		unsigned int align, int partial, rtx reg, int extra,
+		unsigned int align, int partial, rtx reg, poly_int64 extra,
 		rtx args_addr, rtx args_so_far, int reg_parm_stack_space,
 		rtx alignment_pad, bool sibcall_p)
 {
@@ -4357,9 +4357,11 @@  emit_push_insn (rtx x, machine_mode mode
 	  /* Push padding now if padding above and stack grows down,
 	     or if padding below and stack grows up.
 	     But if space already allocated, this has already been done.  */
-	  if (extra && args_addr == 0
-	      && where_pad != PAD_NONE && where_pad != stack_direction)
-	    anti_adjust_stack (GEN_INT (extra));
+	  if (maybe_nonzero (extra)
+	      && args_addr == 0
+	      && where_pad != PAD_NONE
+	      && where_pad != stack_direction)
+	    anti_adjust_stack (gen_int_mode (extra, Pmode));
 
 	  move_by_pieces (NULL, xinner, INTVAL (size) - used, align, 0);
 	}
@@ -4480,9 +4482,11 @@  emit_push_insn (rtx x, machine_mode mode
       /* Push padding now if padding above and stack grows down,
 	 or if padding below and stack grows up.
 	 But if space already allocated, this has already been done.  */
-      if (extra && args_addr == 0
-	  && where_pad != PAD_NONE && where_pad != stack_direction)
-	anti_adjust_stack (GEN_INT (extra));
+      if (maybe_nonzero (extra)
+	  && args_addr == 0
+	  && where_pad != PAD_NONE
+	  && where_pad != stack_direction)
+	anti_adjust_stack (gen_int_mode (extra, Pmode));
 
       /* If we make space by pushing it, we might as well push
 	 the real data.  Otherwise, we can leave OFFSET nonzero
@@ -4531,9 +4535,11 @@  emit_push_insn (rtx x, machine_mode mode
       /* Push padding now if padding above and stack grows down,
 	 or if padding below and stack grows up.
 	 But if space already allocated, this has already been done.  */
-      if (extra && args_addr == 0
-	  && where_pad != PAD_NONE && where_pad != stack_direction)
-	anti_adjust_stack (GEN_INT (extra));
+      if (maybe_nonzero (extra)
+	  && args_addr == 0
+	  && where_pad != PAD_NONE
+	  && where_pad != stack_direction)
+	anti_adjust_stack (gen_int_mode (extra, Pmode));
 
 #ifdef PUSH_ROUNDING
       if (args_addr == 0 && PUSH_ARGS)
@@ -4578,8 +4584,8 @@  emit_push_insn (rtx x, machine_mode mode
 	}
     }
 
-  if (extra && args_addr == 0 && where_pad == stack_direction)
-    anti_adjust_stack (GEN_INT (extra));
+  if (maybe_nonzero (extra) && args_addr == 0 && where_pad == stack_direction)
+    anti_adjust_stack (gen_int_mode (extra, Pmode));
 
   if (alignment_pad && args_addr == 0)
     anti_adjust_stack (alignment_pad);