Patchwork [wide-int] Fix ada builds

login
register
mail settings
Submitter Richard Sandiford
Date Oct. 31, 2013, 8:49 a.m.
Message ID <87a9hpn7tz.fsf@talisman.default>
Download mbox | patch
Permalink /patch/287426/
State New
Headers show

Comments

Richard Sandiford - Oct. 31, 2013, 8:49 a.m.
I applied this obvious patch to get the ada frontend building.

Richard

Patch

Index: gcc/ada/gcc-interface/decl.c
===================================================================
--- gcc/ada/gcc-interface/decl.c	(revision 204174)
+++ gcc/ada/gcc-interface/decl.c	(working copy)
@@ -1658,7 +1658,7 @@ 
 	  TYPE_PRECISION (gnu_type) = esize;
 	  TYPE_UNSIGNED (gnu_type) = is_unsigned;
 	  set_min_and_max_values_for_integral_type (gnu_type, esize,
-						    is_unsigned);
+						    TYPE_SIGN (gnu_type));
 	  process_attributes (&gnu_type, &attr_list, true, gnat_entity);
 	  layout_type (gnu_type);
 
@@ -7492,11 +7492,9 @@ 
       if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST)
 	{
 	  tree op1 = TREE_OPERAND (gnu_size, 1);
-	  wide_int signed_op1
-	    = wide_int::from_tree (op1).sforce_to_size (TYPE_PRECISION (sizetype));
-	  if (signed_op1.neg_p ())
+	  if (wi::neg_p (op1))
 	    {
-	      op1 = wide_int_to_tree (sizetype, -signed_op1);
+	      op1 = wide_int_to_tree (sizetype, wi::neg (op1));
 	      pre_op1 = annotate_value (build1 (NEGATE_EXPR, sizetype, op1));
 	    }
 	}