[wide-int] Fix some formatting

Submitted by Richard Sandiford on Nov. 9, 2013, 10 a.m.

Details

Message ID 87eh6php3b.fsf@talisman.default
State New
Headers show

Commit Message

Richard Sandiford Nov. 9, 2013, 10 a.m.
Fix formatting and remove some spurious differences with trunk
(some of which are ordering rather than formatting, but it didn't
seem worth separating them out).

Also put stuff on a single line in cases where shorter wide-int
code makes that possible.

Applied as obvious (I hope).

Richard

Comments

Mike Stump Nov. 9, 2013, 4:24 p.m.
On Nov 9, 2013, at 2:00 AM, Richard Sandiford <rdsandiford@googlemail.com> wrote:
> Fix formatting and remove some spurious differences with trunk
> (some of which are ordering rather than formatting, but it didn't
> seem worth separating them out).

> Applied as obvious (I hope).

I reviewed it, looks good.

Patch hide | download patch | download mbox

Index: gcc/c-family/cilk.c
===================================================================
--- gcc/c-family/cilk.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/c-family/cilk.c	2013-11-09 09:39:26.719800776 +0000
@@ -662,8 +662,7 @@  declare_one_free_variable (const void *v
 
   /* Maybe promote to int.  */
   if (INTEGRAL_TYPE_P (var_type) && COMPLETE_TYPE_P (var_type)
-      && INT_CST_LT (TYPE_SIZE (var_type),
-		     TYPE_SIZE (integer_type_node)))
+      && INT_CST_LT (TYPE_SIZE (var_type), TYPE_SIZE (integer_type_node)))
     arg_type = integer_type_node;
   else
     arg_type = var_type;
Index: gcc/c/c-typeck.c
===================================================================
--- gcc/c/c-typeck.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/c/c-typeck.c	2013-11-09 09:39:26.721800790 +0000
@@ -4757,8 +4757,7 @@  build_c_cast (location_t loc, tree type,
 	    }
 	  else if (TREE_OVERFLOW (value))
 	    /* Reset VALUE's overflow flags, ensuring constant sharing.  */
-	    value = wide_int_to_tree (TREE_TYPE (value),
-				      value);
+	    value = wide_int_to_tree (TREE_TYPE (value), value);
 	}
     }
 
Index: gcc/cfgexpand.c
===================================================================
--- gcc/cfgexpand.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/cfgexpand.c	2013-11-09 09:39:26.722800797 +0000
@@ -1143,7 +1143,8 @@  defer_stack_allocation (tree var, bool t
      "small" aggregates to the list at all.  */
   if (optimize == 0
       && (tree_to_uhwi (DECL_SIZE_UNIT (var))
-          < (unsigned HOST_WIDE_INT)PARAM_VALUE (PARAM_MIN_SIZE_FOR_STACK_SHARING)))
+          < ((unsigned HOST_WIDE_INT)
+	     PARAM_VALUE (PARAM_MIN_SIZE_FOR_STACK_SHARING))))
     return false;
 
   return true;
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/dwarf2out.c	2013-11-09 09:39:26.725800817 +0000
@@ -5390,9 +5390,11 @@  print_die (dw_die_ref die, FILE *outfile
 	    gcc_assert (i > 0);
 	    if (a->dw_attr_val.v.val_wide->elt (i) == 0)
 	      fprintf (outfile, "0x");
-	    fprintf (outfile, HOST_WIDE_INT_PRINT_HEX, a->dw_attr_val.v.val_wide->elt (--i));
+	    fprintf (outfile, HOST_WIDE_INT_PRINT_HEX,
+		     a->dw_attr_val.v.val_wide->elt (--i));
 	    while (-- i >= 0)
-	      fprintf (outfile, HOST_WIDE_INT_PRINT_PADDED_HEX, a->dw_attr_val.v.val_wide->elt (i));
+	      fprintf (outfile, HOST_WIDE_INT_PRINT_PADDED_HEX,
+		       a->dw_attr_val.v.val_wide->elt (i));
 	    fprintf (outfile, ")");
 	    break;
 	  }
@@ -15108,15 +15110,13 @@  insert_wide_int (const wide_int &val, un
   if (WORDS_BIG_ENDIAN)
     for (i = (int)get_full_len (val) - 1; i >= 0; i--)
       {
-	insert_int ((HOST_WIDE_INT) val.elt (i), 
-		    sizeof (HOST_WIDE_INT), dest);
+	insert_int ((HOST_WIDE_INT) val.elt (i), sizeof (HOST_WIDE_INT), dest);
 	dest += sizeof (HOST_WIDE_INT);
       }
   else
     for (i = 0; i < (int)get_full_len (val); i++)
       {
-	insert_int ((HOST_WIDE_INT) val.elt (i), 
-		    sizeof (HOST_WIDE_INT), dest);
+	insert_int ((HOST_WIDE_INT) val.elt (i), sizeof (HOST_WIDE_INT), dest);
 	dest += sizeof (HOST_WIDE_INT);
       }
 }
Index: gcc/expr.c
===================================================================
--- gcc/expr.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/expr.c	2013-11-09 09:39:26.727800830 +0000
@@ -9721,7 +9721,7 @@  expand_expr_real_1 (tree exp, rtx target
 		  {
 		    tree type = TREE_TYPE (TREE_TYPE (init));
 		    enum machine_mode mode = TYPE_MODE (type);
-		    
+
 		    if (GET_MODE_CLASS (mode) == MODE_INT
 			&& GET_MODE_SIZE (mode) == 1)
 		      return gen_int_mode (TREE_STRING_POINTER (init)
Index: gcc/fold-const.c
===================================================================
--- gcc/fold-const.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/fold-const.c	2013-11-09 09:39:26.729800844 +0000
@@ -1795,8 +1795,7 @@  fold_convert_const_fixed_from_int (tree
   else 
     di.high = TREE_INT_CST_ELT (arg1, 1);
 
-  overflow_p = fixed_convert_from_int (&value, TYPE_MODE (type),
-				       di,
+  overflow_p = fixed_convert_from_int (&value, TYPE_MODE (type), di,
 				       TYPE_UNSIGNED (TREE_TYPE (arg1)),
 				       TYPE_SATURATING (type));
   t = build_fixed (type, value);
@@ -6388,7 +6387,7 @@  fold_div_compare (location_t loc,
   tree prod, tmp, hi, lo;
   tree arg00 = TREE_OPERAND (arg0, 0);
   tree arg01 = TREE_OPERAND (arg0, 1);
-  signop sign  = TYPE_SIGN (TREE_TYPE (arg0));
+  signop sign = TYPE_SIGN (TREE_TYPE (arg0));
   bool neg_overflow = false;
   bool overflow;
 
@@ -11785,7 +11784,7 @@  fold_binary_loc (location_t loc,
 		}
 	    }
 	}
-      
+
       t1 = distribute_bit_expr (loc, code, type, arg0, arg1);
       if (t1 != NULL_TREE)
 	return t1;
Index: gcc/fortran/trans-intrinsic.c
===================================================================
--- gcc/fortran/trans-intrinsic.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/fortran/trans-intrinsic.c	2013-11-09 09:39:26.730800851 +0000
@@ -985,8 +985,7 @@  trans_this_image (gfc_se * se, gfc_expr
       if (INTEGER_CST_P (dim_arg))
 	{
 	  if (wi::ltu_p (dim_arg, 1)
-	      || wi::gtu_p (dim_arg,
-			    GFC_TYPE_ARRAY_CORANK (TREE_TYPE (desc))))
+	      || wi::gtu_p (dim_arg, GFC_TYPE_ARRAY_CORANK (TREE_TYPE (desc))))
 	    gfc_error ("'dim' argument of %s intrinsic at %L is not a valid "
 		       "dimension index", expr->value.function.isym->name,
 		       &expr->where);
Index: gcc/gimple-fold.c
===================================================================
--- gcc/gimple-fold.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/gimple-fold.c	2013-11-09 09:39:26.730800851 +0000
@@ -3047,8 +3047,8 @@  fold_const_aggregate_ref_1 (tree t, tree
 	  tree unit_size = array_ref_element_size (t);
 
 	  /* If the resulting bit-offset is constant, track it.  */
-	  if ((TREE_CODE (low_bound) == INTEGER_CST)
-	      && (tree_fits_uhwi_p (unit_size)))
+	  if (TREE_CODE (low_bound) == INTEGER_CST
+	      && tree_fits_uhwi_p (unit_size))
 	    {
 	      offset_int woffset
 		= wi::sext (wi::to_offset (idx) - wi::to_offset (low_bound),
Index: gcc/optabs.c
===================================================================
--- gcc/optabs.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/optabs.c	2013-11-09 09:39:26.731800858 +0000
@@ -3710,6 +3710,7 @@  expand_copysign_bit (enum machine_mode m
 	op0 = expand_binop (imode, and_optab, op0,
 			    immed_wide_int_const (~mask, imode),
 			    NULL_RTX, 1, OPTAB_LIB_WIDEN);
+
       temp = expand_binop (imode, ior_optab, op0, op1,
 			   gen_lowpart (imode, target), 1, OPTAB_LIB_WIDEN);
       target = lowpart_subreg_maybe_copy (mode, temp, imode);
Index: gcc/real.c
===================================================================
--- gcc/real.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/real.c	2013-11-09 09:39:26.732800864 +0000
@@ -1378,9 +1378,8 @@  real_to_integer (const REAL_VALUE_TYPE *
     }
 }
 
-/* Likewise, but producing a wide-int of PRECISION.  If
-   the value cannot be represented in precision, FAIL is set to
-   TRUE.  */
+/* Likewise, but producing a wide-int of PRECISION.  If the value cannot
+   be represented in precision, *FAIL is set to TRUE.  */
 
 wide_int
 real_to_integer (const REAL_VALUE_TYPE *r, bool *fail, int precision)
@@ -1448,8 +1447,8 @@  real_to_integer (const REAL_VALUE_TYPE *
 	}
 #endif 
       w = SIGSZ * HOST_BITS_PER_LONG + words * HOST_BITS_PER_WIDE_INT; 
-      result = wide_int::from_array (val, 
-	  (w + HOST_BITS_PER_WIDE_INT - 1) / HOST_BITS_PER_WIDE_INT, w, w); 
+      result = wide_int::from_array
+	(val, (w + HOST_BITS_PER_WIDE_INT - 1) / HOST_BITS_PER_WIDE_INT, w);
       result = wi::lrshift (result, (words * HOST_BITS_PER_WIDE_INT) - exp);
       result = wide_int::from (result, precision, UNSIGNED);
 
@@ -2152,8 +2151,7 @@  real_from_string3 (REAL_VALUE_TYPE *r, c
 
 void
 real_from_integer (REAL_VALUE_TYPE *r, enum machine_mode mode,
-		   HOST_WIDE_INT val,
-		   signop sgn)
+		   HOST_WIDE_INT val, signop sgn)
 {
   if (val == 0)
     get_zero (r, 0);
@@ -2198,9 +2196,10 @@  real_from_integer (REAL_VALUE_TYPE *r, e
   else
     {
       unsigned int len = val_in.get_precision ();
-      int i, j, e=0;
+      int i, j, e = 0;
       int maxbitlen = MAX_BITSIZE_MODE_ANY_INT + HOST_BITS_PER_WIDE_INT;
-      const unsigned int realmax = SIGNIFICAND_BITS/HOST_BITS_PER_WIDE_INT * HOST_BITS_PER_WIDE_INT;
+      const unsigned int realmax = (SIGNIFICAND_BITS / HOST_BITS_PER_WIDE_INT
+				    * HOST_BITS_PER_WIDE_INT);
 
       memset (r, 0, sizeof (*r));
       r->cl = rvc_normal;
Index: gcc/recog.c
===================================================================
--- gcc/recog.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/recog.c	2013-11-09 09:39:26.732800864 +0000
@@ -1248,8 +1248,7 @@  nonimmediate_operand (rtx op, enum machi
   return (general_operand (op, mode) && ! CONSTANT_P (op));
 }
 
-/* Return 1 if OP is a register reference or immediate value of mode
-   MODE.  */
+/* Return 1 if OP is a register reference or immediate value of mode MODE.  */
 
 int
 nonmemory_operand (rtx op, enum machine_mode mode)
Index: gcc/rtl.c
===================================================================
--- gcc/rtl.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/rtl.c	2013-11-09 09:39:26.733800871 +0000
@@ -457,6 +457,7 @@  rtx_equal_p_cb (const_rtx x, const_rtx y
 	  if (XWINT (x, i) != XWINT (y, i))
 	    return 0;
 	  break;
+
 	case 'n':
 	case 'i':
 	  if (XINT (x, i) != XINT (y, i))
Index: gcc/rtl.h
===================================================================
--- gcc/rtl.h	2013-11-09 09:39:17.973741665 +0000
+++ gcc/rtl.h	2013-11-09 09:39:26.733800871 +0000
@@ -350,9 +350,9 @@  struct GTY((chain_next ("RTX_NEXT (&%h)"
   union {
     /* RTXs are free to use up to 32 bit from here.  */
 
-    /* In a CONST_WIDE_INT (aka hwivec_def), this is the number of HOST_WIDE_INTs
-       in the hwivec_def.  */
-    unsigned  GTY ((tag ("CONST_WIDE_INT"))) num_elem:32;
+    /* In a CONST_WIDE_INT (aka hwivec_def), this is the number of
+       HOST_WIDE_INTs in the hwivec_def.  */
+    unsigned GTY ((tag ("CONST_WIDE_INT"))) num_elem:32;
   } GTY ((desc ("GET_CODE (&%0)"))) u2;
 
   /* The first element of the operands of this rtx.
@@ -404,13 +404,13 @@  #define PUT_MODE(RTX, MODE) ((RTX)->mode
    for a variable number of things.  The principle use is inside
    PARALLEL expressions.  */
 
-#define NULL_RTVEC (rtvec) 0
-
 struct GTY((variable_size)) rtvec_def {
   int num_elem;		/* number of elements */
   rtx GTY ((length ("%h.num_elem"))) elem[1];
 };
 
+#define NULL_RTVEC (rtvec) 0
+
 #define GET_NUM_ELEM(RTVEC)		((RTVEC)->num_elem)
 #define PUT_NUM_ELEM(RTVEC, NUM)	((RTVEC)->num_elem = (NUM))
 
Index: gcc/simplify-rtx.c
===================================================================
--- gcc/simplify-rtx.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/simplify-rtx.c	2013-11-09 09:39:26.735800885 +0000
@@ -1686,7 +1686,7 @@  simplify_const_unary_operation (enum rtx
 	case CLRSB:
 	  result = wi::shwi (wi::clrsb (op0), mode);
 	  break;
-	  
+
 	case CTZ:
 	  result = wi::shwi (wi::ctz (op0), mode);
 	  break;
@@ -5122,7 +5122,7 @@  simplify_immed_subreg (enum machine_mode
     value_bit = 8,
     value_mask = (1 << value_bit) - 1
   };
-  unsigned char value[MAX_BITSIZE_MODE_ANY_MODE/value_bit];
+  unsigned char value[MAX_BITSIZE_MODE_ANY_MODE / value_bit];
   int value_start;
   int i;
   int elem;
Index: gcc/trans-mem.c
===================================================================
--- gcc/trans-mem.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/trans-mem.c	2013-11-09 09:39:26.735800885 +0000
@@ -1078,7 +1078,7 @@  tm_log_add (basic_block entry_block, tre
 	  && transaction_invariant_address_p (lp->addr, entry_block)
 	  && TYPE_SIZE_UNIT (type) != NULL
 	  && tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))
-	  && ((HOST_WIDE_INT)(tree_to_uhwi (TYPE_SIZE_UNIT (type)))
+	  && ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE_UNIT (type))
 	      < PARAM_VALUE (PARAM_TM_MAX_AGGREGATE_SIZE))
 	  /* We must be able to copy this type normally.  I.e., no
 	     special constructors and the like.  */
Index: gcc/tree-affine.c
===================================================================
--- gcc/tree-affine.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/tree-affine.c	2013-11-09 09:39:26.736800891 +0000
@@ -29,7 +29,6 @@  Free Software Foundation; either version
 #include "dumpfile.h"
 #include "wide-int-print.h"
 
-
 /* Extends CST as appropriate for the affine combinations COMB.  */
 
 widest_int
Index: gcc/tree-ssa-address.c
===================================================================
--- gcc/tree-ssa-address.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/tree-ssa-address.c	2013-11-09 09:39:26.736800891 +0000
@@ -881,8 +881,8 @@  copy_ref_info (tree new_ref, tree old_re
 			   && (tree_to_hwi (TMR_STEP (new_ref))
 			       < align)))))
 	    {
-	      unsigned int inc = mem_ref_offset (old_ref).to_uhwi ()
-				  - mem_ref_offset (new_ref).to_uhwi ();
+	      unsigned int inc = (mem_ref_offset (old_ref).to_uhwi ()
+				  - mem_ref_offset (new_ref).to_uhwi ());
 	      adjust_ptr_info_misalignment (new_pi, inc);
 	    }
 	  else
Index: gcc/tree-ssa-ccp.c
===================================================================
--- gcc/tree-ssa-ccp.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/tree-ssa-ccp.c	2013-11-09 09:39:26.736800891 +0000
@@ -489,8 +489,7 @@  set_lattice_value (tree var, prop_value_
       || (new_val.lattice_val == CONSTANT
 	  && TREE_CODE (new_val.value) == INTEGER_CST
 	  && (TREE_CODE (old_val->value) != INTEGER_CST
-	      || new_val.mask 
-	      != old_val->mask)))
+	      || new_val.mask != old_val->mask)))
     {
       /* ???  We would like to delay creation of INTEGER_CSTs from
 	 partially constants here.  */
@@ -1749,7 +1748,8 @@  evaluate_stmt (gimple stmt)
     {
       tree lhs = gimple_get_lhs (stmt);
       widest_int nonzero_bits = get_nonzero_bits (lhs);
-      widest_int mask = wi::mask <widest_int> (TYPE_PRECISION (TREE_TYPE (lhs)), false);
+      widest_int mask
+	= wi::mask <widest_int> (TYPE_PRECISION (TREE_TYPE (lhs)), false);
       if (nonzero_bits != -1 && nonzero_bits != mask)
 	{
 	  if (!is_constant)
Index: gcc/tree-ssa-loop-ivopts.c
===================================================================
--- gcc/tree-ssa-loop-ivopts.c	2013-11-09 09:39:24.871788286 +0000
+++ gcc/tree-ssa-loop-ivopts.c	2013-11-09 09:39:26.737800898 +0000
@@ -3498,7 +3498,6 @@  get_shiftadd_cost (tree expr, enum machi
     res = add_costs (res, force_expr_to_var_cost (multop, speed));
 
   *cost = res;
-
   return true;
 }
 
@@ -3613,7 +3612,6 @@  force_expr_to_var_cost (tree expr, bool
       break;
 
     default:
-
       /* Just an arbitrary value, FIXME.  */
       return new_cost (target_spill_cost[speed], 0);
     }
Index: gcc/tree-vrp.c
===================================================================
--- gcc/tree-vrp.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/tree-vrp.c	2013-11-09 09:39:26.738800905 +0000
@@ -8622,9 +8622,11 @@  simplify_bit_ops_using_ranges (gimple_st
   else
     return false;
 
-  if (!zero_nonzero_bits_from_vr (TREE_TYPE (op0), &vr0, &may_be_nonzero0, &must_be_nonzero0))
+  if (!zero_nonzero_bits_from_vr (TREE_TYPE (op0), &vr0, &may_be_nonzero0,
+				  &must_be_nonzero0))
     return false;
-  if (!zero_nonzero_bits_from_vr (TREE_TYPE (op1), &vr1, &may_be_nonzero1, &must_be_nonzero1))
+  if (!zero_nonzero_bits_from_vr (TREE_TYPE (op1), &vr1, &may_be_nonzero1,
+				  &must_be_nonzero1))
     return false;
 
   switch (gimple_assign_rhs_code (stmt))
@@ -9181,7 +9183,6 @@  simplify_float_conversion_using_ranges (
 simplify_stmt_using_ranges (gimple_stmt_iterator *gsi)
 {
   gimple stmt = gsi_stmt (*gsi);
-
   if (is_gimple_assign (stmt))
     {
       enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
Index: gcc/tree.c
===================================================================
--- gcc/tree.c	2013-11-09 09:39:17.973741665 +0000
+++ gcc/tree.c	2013-11-09 09:39:26.740800918 +0000
@@ -1780,8 +1780,7 @@  real_value_from_int_cst (const_tree type
   memset (&d, 0, sizeof d);
 
   real_from_integer (&d, type ? TYPE_MODE (type) : VOIDmode,
-		     wide_int (i),
-		     TYPE_SIGN (TREE_TYPE (i)));
+		     wide_int (i), TYPE_SIGN (TREE_TYPE (i)));
   return d;
 }
 
@@ -6708,7 +6707,7 @@  type_hash_eq (const void *va, const void
     case REAL_TYPE:
     case BOOLEAN_TYPE:
       if (TYPE_PRECISION (a->type) != TYPE_PRECISION (b->type))
-	  return false;
+	return false;
       return ((TYPE_MAX_VALUE (a->type) == TYPE_MAX_VALUE (b->type)
 	       || tree_int_cst_equal (TYPE_MAX_VALUE (a->type),
 				      TYPE_MAX_VALUE (b->type)))
Index: gcc/tree.h
===================================================================
--- gcc/tree.h	2013-11-09 09:39:17.973741665 +0000
+++ gcc/tree.h	2013-11-09 09:39:26.740800918 +0000
@@ -759,7 +759,7 @@  #define DECL_UNSIGNED(NODE) \
 #define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->base.u.bits.unsigned_flag)
 
 /* Same as TYPE_UNSIGNED but converted to SIGNOP.  */
-#define TYPE_SIGN(NODE) ((signop)TYPE_UNSIGNED(NODE))
+#define TYPE_SIGN(NODE) ((signop) TYPE_UNSIGNED (NODE))
 
 /* True if overflow wraps around for the given integral type.  That
    is, TYPE_MAX + 1 == TYPE_MIN.  */