diff mbox

Fix formatting glitches

Message ID 4624591.C4o3bAam0C@polaris
State New
Headers show

Commit Message

Eric Botcazou June 25, 2013, 7:22 a.m. UTC
This fixes a few formatting glitches introduced in very recent patches that I 
ran into when merging them on the sso branch.

Bootstrapped/regtested on x86_64-suse-linux, applied on mainline as obvious.


2013-06-25  Eric Botcazou  <ebotcazou@adacore.com>

	* expr.c (expand_expr_real_1) <ARRAY_REF>: Fix formatting glitches.
	<BIT_FIELD_REF>: Remove trailing TAB.
	* varasm.c (output_constructor_bitfield): Fix formatting glitch and
	remove blank line.
diff mbox

Patch

Index: expr.c
===================================================================
--- expr.c	(revision 200350)
+++ expr.c	(working copy)
@@ -9698,7 +9698,7 @@  expand_expr_real_1 (tree exp, rtx target
       {
 	tree array = treeop0;
 	tree index = treeop1;
-        tree init;
+	tree init;
 
 	/* Fold an expression like: "foo"[2].
 	   This is not done in fold so it won't happen inside &.
@@ -9776,32 +9776,31 @@  expand_expr_real_1 (tree exp, rtx target
 			    break;
 			}
 
-		      return expand_expr (fold (value), target, tmode,
-					  modifier);
+		      return
+		        expand_expr (fold (value), target, tmode, modifier);
 		    }
 	      }
-	    else if(TREE_CODE (init) == STRING_CST)
+	    else if (TREE_CODE (init) == STRING_CST)
 	      {
-		tree index1 = index;
 		tree low_bound = array_ref_low_bound (exp);
-		index1 = fold_convert_loc (loc, sizetype,
-					   treeop1);
+		tree index1 = fold_convert_loc (loc, sizetype, treeop1);
 
-		/* Optimize the special-case of a zero lower bound.
+		/* Optimize the special case of a zero lower bound.
 
-		   We convert the low_bound to sizetype to avoid some problems
-		   with constant folding.  (E.g. suppose the lower bound is 1,
-		   and its mode is QI.  Without the conversion,l (ARRAY
-		   +(INDEX-(unsigned char)1)) becomes ((ARRAY+(-(unsigned char)1))
-		   +INDEX), which becomes (ARRAY+255+INDEX).  Opps!)  */
-
-		if (! integer_zerop (low_bound))
+		   We convert the lower bound to sizetype to avoid problems
+		   with constant folding.  E.g. suppose the lower bound is
+		   1 and its mode is QI.  Without the conversion
+		      (ARRAY + (INDEX - (unsigned char)1))
+		   becomes
+		      (ARRAY + (-(unsigned char)1) + INDEX)
+		   which becomes
+		      (ARRAY + 255 + INDEX).  Oops!  */
+		if (!integer_zerop (low_bound))
 		  index1 = size_diffop_loc (loc, index1,
-					fold_convert_loc (loc, sizetype,
-							  low_bound));
+					    fold_convert_loc (loc, sizetype,
+							      low_bound));
 
-		if (0 > compare_tree_int (index1,
-					  TREE_STRING_LENGTH (init)))
+		if (compare_tree_int (index1, TREE_STRING_LENGTH (init)) < 0)
 		  {
 		    tree type = TREE_TYPE (TREE_TYPE (init));
 		    enum machine_mode mode = TYPE_MODE (type);
@@ -10187,7 +10186,7 @@  expand_expr_real_1 (tree exp, rtx target
 	    || modifier == EXPAND_CONST_ADDRESS
 	    || modifier == EXPAND_INITIALIZER)
 	  return op0;
-	
+
 	if (target == 0)
 	  target = gen_reg_rtx (tmode != VOIDmode ? tmode : mode);
 
Index: varasm.c
===================================================================
--- varasm.c	(revision 200350)
+++ varasm.c	(working copy)
@@ -4947,7 +4947,7 @@  output_constructor_bitfield (oc_local_st
   /* Bit position of this element from the start of a possibly ongoing
      outer byte buffer.  */
   HOST_WIDE_INT byte_relative_ebitpos
-      = bit_offset + constructor_relative_ebitpos;
+    = bit_offset + constructor_relative_ebitpos;
 
   /* From the start of a possibly ongoing outer byte buffer, offsets to
      the first bit of this element and to the first bit past the end of
@@ -5131,7 +5131,6 @@  output_constructor (tree exp, unsigned H
   local.total_bytes = 0;
   local.byte_buffer_in_use = outer != NULL;
   local.byte = outer ? outer->byte : 0;
-
   local.last_relative_index = -1;
 
   gcc_assert (HOST_BITS_PER_WIDE_INT >= BITS_PER_UNIT);