OSDN Git Service

* double-int.h (HOST_BITS_PER_DOUBLE_INT): Define.
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Apr 2010 22:05:32 +0000 (22:05 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 01:02:00 +0000 (10:02 +0900)
(double_int_not, double_int_lshift, double_int_rshift): Declare.
(double_int_negative_p): Convert to static inline function.
* double-int.c (double_int_lshift, double_int_lshift): Add new function.
(double_int_negative_p): Remove.
* tree.h (lshift_double, rshift_double):
* tree.c (build_low_bits_mask): Clean up, use double_int_* functions.
* fold-const.c (fold_convert_const_int_from_real,
fold_convert_const_int_from_fixed, div_if_zero_remainder): (Ditto.).
(lshift_double): Change type of arith argument to bool.
(rshift_double): Change type of arith argument to bool. Correct
comment.
* expmed.c (mask_rtx, lshift_value): (Ditto.).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158360 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/double-int.c
gcc/double-int.h
gcc/expmed.c
gcc/fold-const.c
gcc/tree.h

index b09f10f..35a1633 100644 (file)
@@ -1,3 +1,19 @@
+2010-04-15  Anatoly Sokolov  <aesok@post.ru>
+
+       * double-int.h (HOST_BITS_PER_DOUBLE_INT): Define.
+       (double_int_not, double_int_lshift, double_int_rshift): Declare.
+       (double_int_negative_p): Convert to static inline function.
+       * double-int.c (double_int_lshift, double_int_lshift): Add new function.
+       (double_int_negative_p): Remove.
+       * tree.h (lshift_double, rshift_double): 
+       * tree.c (build_low_bits_mask): Clean up, use double_int_* functions.
+       * fold-const.c (fold_convert_const_int_from_real,
+       fold_convert_const_int_from_fixed, div_if_zero_remainder): (Ditto.).
+       (lshift_double): Change type of arith argument to bool.
+       (rshift_double): Change type of arith argument to bool. Correct
+       comment.
+       * expmed.c (mask_rtx, lshift_value): (Ditto.).
+
 2010-04-14  Bernd Schmidt  <bernd.schmidt@codesourcery.com>
        
        PR target/21803
index 000be2b..1a74681 100644 (file)
@@ -23,741 +23,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 
-/* We know that A1 + B1 = SUM1, using 2's complement arithmetic and ignoring
-   overflow.  Suppose A, B and SUM have the same respective signs as A1, B1,
-   and SUM1.  Then this yields nonzero if overflow occurred during the
-   addition.
-
-   Overflow occurs if A and B have the same sign, but A and SUM differ in
-   sign.  Use `^' to test whether signs differ, and `< 0' to isolate the
-   sign.  */
-#define OVERFLOW_SUM_SIGN(a, b, sum) ((~((a) ^ (b)) & ((a) ^ (sum))) < 0)
-
-/* To do constant folding on INTEGER_CST nodes requires two-word arithmetic.
-   We do that by representing the two-word integer in 4 words, with only
-   HOST_BITS_PER_WIDE_INT / 2 bits stored in each word, as a positive
-   number.  The value of the word is LOWPART + HIGHPART * BASE.  */
-
-#define LOWPART(x) \
-  ((x) & (((unsigned HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) - 1))
-#define HIGHPART(x) \
-  ((unsigned HOST_WIDE_INT) (x) >> HOST_BITS_PER_WIDE_INT / 2)
-#define BASE ((unsigned HOST_WIDE_INT) 1 << HOST_BITS_PER_WIDE_INT / 2)
-
-/* Unpack a two-word integer into 4 words.
-   LOW and HI are the integer, as two `HOST_WIDE_INT' pieces.
-   WORDS points to the array of HOST_WIDE_INTs.  */
-
-static void
-encode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT low, HOST_WIDE_INT hi)
-{
-  words[0] = LOWPART (low);
-  words[1] = HIGHPART (low);
-  words[2] = LOWPART (hi);
-  words[3] = HIGHPART (hi);
-}
-
-/* Pack an array of 4 words into a two-word integer.
-   WORDS points to the array of words.
-   The integer is stored into *LOW and *HI as two `HOST_WIDE_INT' pieces.  */
-
-static void
-decode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT *low,
-       HOST_WIDE_INT *hi)
-{
-  *low = words[0] + words[1] * BASE;
-  *hi = words[2] + words[3] * BASE;
-}
-
-/* Force the double-word integer L1, H1 to be within the range of the
-   integer type TYPE.  Stores the properly truncated and sign-extended
-   double-word integer in *LV, *HV.  Returns true if the operation
-   overflows, that is, argument and result are different.  */
-
-int
-fit_double_type (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
-                unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, const_tree type)
-{
-  unsigned HOST_WIDE_INT low0 = l1;
-  HOST_WIDE_INT high0 = h1;
-  unsigned int prec = TYPE_PRECISION (type);
-  int sign_extended_type;
-
-  /* Size types *are* sign extended.  */
-  sign_extended_type = (!TYPE_UNSIGNED (type)
-                       || (TREE_CODE (type) == INTEGER_TYPE
-                           && TYPE_IS_SIZETYPE (type)));
-
-  /* First clear all bits that are beyond the type's precision.  */
-  if (prec >= 2 * HOST_BITS_PER_WIDE_INT)
-    ;
-  else if (prec > HOST_BITS_PER_WIDE_INT)
-    h1 &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT));
-  else
-    {
-      h1 = 0;
-      if (prec < HOST_BITS_PER_WIDE_INT)
-       l1 &= ~((HOST_WIDE_INT) (-1) << prec);
-    }
-
-  /* Then do sign extension if necessary.  */
-  if (!sign_extended_type)
-    /* No sign extension */;
-  else if (prec >= 2 * HOST_BITS_PER_WIDE_INT)
-    /* Correct width already.  */;
-  else if (prec > HOST_BITS_PER_WIDE_INT)
-    {
-      /* Sign extend top half? */
-      if (h1 & ((unsigned HOST_WIDE_INT)1
-               << (prec - HOST_BITS_PER_WIDE_INT - 1)))
-       h1 |= (HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT);
-    }
-  else if (prec == HOST_BITS_PER_WIDE_INT)
-    {
-      if ((HOST_WIDE_INT)l1 < 0)
-       h1 = -1;
-    }
-  else
-    {
-      /* Sign extend bottom half? */
-      if (l1 & ((unsigned HOST_WIDE_INT)1 << (prec - 1)))
-       {
-         h1 = -1;
-         l1 |= (HOST_WIDE_INT)(-1) << prec;
-       }
-    }
-
-  *lv = l1;
-  *hv = h1;
-
-  /* If the value didn't fit, signal overflow.  */
-  return l1 != low0 || h1 != high0;
-}
-
-/* We force the double-int HIGH:LOW to the range of the type TYPE by
-   sign or zero extending it.
-   OVERFLOWABLE indicates if we are interested
-   in overflow of the value, when >0 we are only interested in signed
-   overflow, for <0 we are interested in any overflow.  OVERFLOWED
-   indicates whether overflow has already occurred.  CONST_OVERFLOWED
-   indicates whether constant overflow has already occurred.  We force
-   T's value to be within range of T's type (by setting to 0 or 1 all
-   the bits outside the type's range).  We set TREE_OVERFLOWED if,
-       OVERFLOWED is nonzero,
-       or OVERFLOWABLE is >0 and signed overflow occurs
-       or OVERFLOWABLE is <0 and any overflow occurs
-   We return a new tree node for the extended double-int.  The node
-   is shared if no overflow flags are set.  */
-
-tree
-force_fit_type_double (tree type, unsigned HOST_WIDE_INT low,
-                      HOST_WIDE_INT high, int overflowable,
-                      bool overflowed)
-{
-  int sign_extended_type;
-  bool overflow;
-
-  /* Size types *are* sign extended.  */
-  sign_extended_type = (!TYPE_UNSIGNED (type)
-                       || (TREE_CODE (type) == INTEGER_TYPE
-                           && TYPE_IS_SIZETYPE (type)));
-
-  overflow = fit_double_type (low, high, &low, &high, type);
-
-  /* If we need to set overflow flags, return a new unshared node.  */
-  if (overflowed || overflow)
-    {
-      if (overflowed
-         || overflowable < 0
-         || (overflowable > 0 && sign_extended_type))
-       {
-          tree t = make_node (INTEGER_CST);
-          TREE_INT_CST_LOW (t) = low;
-          TREE_INT_CST_HIGH (t) = high;
-          TREE_TYPE (t) = type;
-         TREE_OVERFLOW (t) = 1;
-         return t;
-       }
-    }
-
-  /* Else build a shared node.  */
-  return build_int_cst_wide (type, low, high);
-}
-
-/* Add two doubleword integers with doubleword result.
-   Return nonzero if the operation overflows according to UNSIGNED_P.
-   Each argument is given as two `HOST_WIDE_INT' pieces.
-   One argument is L1 and H1; the other, L2 and H2.
-   The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
-
-int
-add_double_with_sign (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
-                     unsigned HOST_WIDE_INT l2, HOST_WIDE_INT h2,
-                     unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv,
-                     bool unsigned_p)
-{
-  unsigned HOST_WIDE_INT l;
-  HOST_WIDE_INT h;
-
-  l = l1 + l2;
-  h = (HOST_WIDE_INT) ((unsigned HOST_WIDE_INT) h1
-                      + (unsigned HOST_WIDE_INT) h2
-                      + (l < l1));
-
-  *lv = l;
-  *hv = h;
-
-  if (unsigned_p)
-    return ((unsigned HOST_WIDE_INT) h < (unsigned HOST_WIDE_INT) h1
-           || (h == h1
-               && l < l1));
-  else
-    return OVERFLOW_SUM_SIGN (h1, h2, h);
-}
-
-/* Negate a doubleword integer with doubleword result.
-   Return nonzero if the operation overflows, assuming it's signed.
-   The argument is given as two `HOST_WIDE_INT' pieces in L1 and H1.
-   The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
-
-int
-neg_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
-           unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
-{
-  if (l1 == 0)
-    {
-      *lv = 0;
-      *hv = - h1;
-      return (*hv & h1) < 0;
-    }
-  else
-    {
-      *lv = -l1;
-      *hv = ~h1;
-      return 0;
-    }
-}
-
-/* Multiply two doubleword integers with doubleword result.
-   Return nonzero if the operation overflows according to UNSIGNED_P.
-   Each argument is given as two `HOST_WIDE_INT' pieces.
-   One argument is L1 and H1; the other, L2 and H2.
-   The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
-
-int
-mul_double_with_sign (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
-                     unsigned HOST_WIDE_INT l2, HOST_WIDE_INT h2,
-                     unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv,
-                     bool unsigned_p)
-{
-  HOST_WIDE_INT arg1[4];
-  HOST_WIDE_INT arg2[4];
-  HOST_WIDE_INT prod[4 * 2];
-  unsigned HOST_WIDE_INT carry;
-  int i, j, k;
-  unsigned HOST_WIDE_INT toplow, neglow;
-  HOST_WIDE_INT tophigh, neghigh;
-
-  encode (arg1, l1, h1);
-  encode (arg2, l2, h2);
-
-  memset (prod, 0, sizeof prod);
-
-  for (i = 0; i < 4; i++)
-    {
-      carry = 0;
-      for (j = 0; j < 4; j++)
-       {
-         k = i + j;
-         /* This product is <= 0xFFFE0001, the sum <= 0xFFFF0000.  */
-         carry += arg1[i] * arg2[j];
-         /* Since prod[p] < 0xFFFF, this sum <= 0xFFFFFFFF.  */
-         carry += prod[k];
-         prod[k] = LOWPART (carry);
-         carry = HIGHPART (carry);
-       }
-      prod[i + 4] = carry;
-    }
-
-  decode (prod, lv, hv);
-  decode (prod + 4, &toplow, &tophigh);
-
-  /* Unsigned overflow is immediate.  */
-  if (unsigned_p)
-    return (toplow | tophigh) != 0;
-
-  /* Check for signed overflow by calculating the signed representation of the
-     top half of the result; it should agree with the low half's sign bit.  */
-  if (h1 < 0)
-    {
-      neg_double (l2, h2, &neglow, &neghigh);
-      add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh);
-    }
-  if (h2 < 0)
-    {
-      neg_double (l1, h1, &neglow, &neghigh);
-      add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh);
-    }
-  return (*hv < 0 ? ~(toplow & tophigh) : toplow | tophigh) != 0;
-}
-
-/* Shift the doubleword integer in L1, H1 left by COUNT places
-   keeping only PREC bits of result.
-   Shift right if COUNT is negative.
-   ARITH nonzero specifies arithmetic shifting; otherwise use logical shift.
-   Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
-
-void
-lshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
-              HOST_WIDE_INT count, unsigned int prec,
-              unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, bool arith)
-{
-  unsigned HOST_WIDE_INT signmask;
-
-  if (count < 0)
-    {
-      rshift_double (l1, h1, -count, prec, lv, hv, arith);
-      return;
-    }
-
-  if (SHIFT_COUNT_TRUNCATED)
-    count %= prec;
-
-  if (count >= 2 * HOST_BITS_PER_WIDE_INT)
-    {
-      /* Shifting by the host word size is undefined according to the
-        ANSI standard, so we must handle this as a special case.  */
-      *hv = 0;
-      *lv = 0;
-    }
-  else if (count >= HOST_BITS_PER_WIDE_INT)
-    {
-      *hv = l1 << (count - HOST_BITS_PER_WIDE_INT);
-      *lv = 0;
-    }
-  else
-    {
-      *hv = (((unsigned HOST_WIDE_INT) h1 << count)
-            | (l1 >> (HOST_BITS_PER_WIDE_INT - count - 1) >> 1));
-      *lv = l1 << count;
-    }
-
-  /* Sign extend all bits that are beyond the precision.  */
-
-  signmask = -((prec > HOST_BITS_PER_WIDE_INT
-               ? ((unsigned HOST_WIDE_INT) *hv
-                  >> (prec - HOST_BITS_PER_WIDE_INT - 1))
-               : (*lv >> (prec - 1))) & 1);
-
-  if (prec >= 2 * HOST_BITS_PER_WIDE_INT)
-    ;
-  else if (prec >= HOST_BITS_PER_WIDE_INT)
-    {
-      *hv &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT));
-      *hv |= signmask << (prec - HOST_BITS_PER_WIDE_INT);
-    }
-  else
-    {
-      *hv = signmask;
-      *lv &= ~((unsigned HOST_WIDE_INT) (-1) << prec);
-      *lv |= signmask << prec;
-    }
-}
-
-/* Shift the doubleword integer in L1, H1 right by COUNT places
-   keeping only PREC bits of result.  Shift left if COUNT is negative.
-   ARITH nonzero specifies arithmetic shifting; otherwise use logical shift.
-   Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
-
-void
-rshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
-              HOST_WIDE_INT count, unsigned int prec,
-              unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv,
-              bool arith)
-{
-  unsigned HOST_WIDE_INT signmask;
-
-  if (count < 0)
-    {
-      lshift_double (l1, h1, -count, prec, lv, hv, arith);
-      return;
-    }
-
-  signmask = (arith
-             ? -((unsigned HOST_WIDE_INT) h1 >> (HOST_BITS_PER_WIDE_INT - 1))
-             : 0);
-
-  if (SHIFT_COUNT_TRUNCATED)
-    count %= prec;
-
-  if (count >= 2 * HOST_BITS_PER_WIDE_INT)
-    {
-      /* Shifting by the host word size is undefined according to the
-        ANSI standard, so we must handle this as a special case.  */
-      *hv = 0;
-      *lv = 0;
-    }
-  else if (count >= HOST_BITS_PER_WIDE_INT)
-    {
-      *hv = 0;
-      *lv = (unsigned HOST_WIDE_INT) h1 >> (count - HOST_BITS_PER_WIDE_INT);
-    }
-  else
-    {
-      *hv = (unsigned HOST_WIDE_INT) h1 >> count;
-      *lv = ((l1 >> count)
-            | ((unsigned HOST_WIDE_INT) h1
-               << (HOST_BITS_PER_WIDE_INT - count - 1) << 1));
-    }
-
-  /* Zero / sign extend all bits that are beyond the precision.  */
-
-  if (count >= (HOST_WIDE_INT)prec)
-    {
-      *hv = signmask;
-      *lv = signmask;
-    }
-  else if ((prec - count) >= 2 * HOST_BITS_PER_WIDE_INT)
-    ;
-  else if ((prec - count) >= HOST_BITS_PER_WIDE_INT)
-    {
-      *hv &= ~((HOST_WIDE_INT) (-1) << (prec - count - HOST_BITS_PER_WIDE_INT));
-      *hv |= signmask << (prec - count - HOST_BITS_PER_WIDE_INT);
-    }
-  else
-    {
-      *hv = signmask;
-      *lv &= ~((unsigned HOST_WIDE_INT) (-1) << (prec - count));
-      *lv |= signmask << (prec - count);
-    }
-}
-
-/* Rotate the doubleword integer in L1, H1 left by COUNT places
-   keeping only PREC bits of result.
-   Rotate right if COUNT is negative.
-   Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
-
-void
-lrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
-               HOST_WIDE_INT count, unsigned int prec,
-               unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
-{
-  unsigned HOST_WIDE_INT s1l, s2l;
-  HOST_WIDE_INT s1h, s2h;
-
-  count %= prec;
-  if (count < 0)
-    count += prec;
-
-  lshift_double (l1, h1, count, prec, &s1l, &s1h, 0);
-  rshift_double (l1, h1, prec - count, prec, &s2l, &s2h, 0);
-  *lv = s1l | s2l;
-  *hv = s1h | s2h;
-}
-
-/* Rotate the doubleword integer in L1, H1 left by COUNT places
-   keeping only PREC bits of result.  COUNT must be positive.
-   Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
-
-void
-rrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
-               HOST_WIDE_INT count, unsigned int prec,
-               unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
-{
-  unsigned HOST_WIDE_INT s1l, s2l;
-  HOST_WIDE_INT s1h, s2h;
-
-  count %= prec;
-  if (count < 0)
-    count += prec;
-
-  rshift_double (l1, h1, count, prec, &s1l, &s1h, 0);
-  lshift_double (l1, h1, prec - count, prec, &s2l, &s2h, 0);
-  *lv = s1l | s2l;
-  *hv = s1h | s2h;
-}
-
-/* Divide doubleword integer LNUM, HNUM by doubleword integer LDEN, HDEN
-   for a quotient (stored in *LQUO, *HQUO) and remainder (in *LREM, *HREM).
-   CODE is a tree code for a kind of division, one of
-   TRUNC_DIV_EXPR, FLOOR_DIV_EXPR, CEIL_DIV_EXPR, ROUND_DIV_EXPR
-   or EXACT_DIV_EXPR
-   It controls how the quotient is rounded to an integer.
-   Return nonzero if the operation overflows.
-   UNS nonzero says do unsigned division.  */
-
-int
-div_and_round_double (unsigned code, int uns,
-                     /* num == numerator == dividend */
-                     unsigned HOST_WIDE_INT lnum_orig,
-                     HOST_WIDE_INT hnum_orig,
-                     /* den == denominator == divisor */
-                     unsigned HOST_WIDE_INT lden_orig,
-                     HOST_WIDE_INT hden_orig,
-                     unsigned HOST_WIDE_INT *lquo,
-                     HOST_WIDE_INT *hquo, unsigned HOST_WIDE_INT *lrem,
-                     HOST_WIDE_INT *hrem)
-{
-  int quo_neg = 0;
-  HOST_WIDE_INT num[4 + 1];    /* extra element for scaling.  */
-  HOST_WIDE_INT den[4], quo[4];
-  int i, j;
-  unsigned HOST_WIDE_INT work;
-  unsigned HOST_WIDE_INT carry = 0;
-  unsigned HOST_WIDE_INT lnum = lnum_orig;
-  HOST_WIDE_INT hnum = hnum_orig;
-  unsigned HOST_WIDE_INT lden = lden_orig;
-  HOST_WIDE_INT hden = hden_orig;
-  int overflow = 0;
-
-  if (hden == 0 && lden == 0)
-    overflow = 1, lden = 1;
-
-  /* Calculate quotient sign and convert operands to unsigned.  */
-  if (!uns)
-    {
-      if (hnum < 0)
-       {
-         quo_neg = ~ quo_neg;
-         /* (minimum integer) / (-1) is the only overflow case.  */
-         if (neg_double (lnum, hnum, &lnum, &hnum)
-             && ((HOST_WIDE_INT) lden & hden) == -1)
-           overflow = 1;
-       }
-      if (hden < 0)
-       {
-         quo_neg = ~ quo_neg;
-         neg_double (lden, hden, &lden, &hden);
-       }
-    }
-
-  if (hnum == 0 && hden == 0)
-    {                          /* single precision */
-      *hquo = *hrem = 0;
-      /* This unsigned division rounds toward zero.  */
-      *lquo = lnum / lden;
-      goto finish_up;
-    }
-
-  if (hnum == 0)
-    {                          /* trivial case: dividend < divisor */
-      /* hden != 0 already checked.  */
-      *hquo = *lquo = 0;
-      *hrem = hnum;
-      *lrem = lnum;
-      goto finish_up;
-    }
-
-  memset (quo, 0, sizeof quo);
-
-  memset (num, 0, sizeof num); /* to zero 9th element */
-  memset (den, 0, sizeof den);
-
-  encode (num, lnum, hnum);
-  encode (den, lden, hden);
-
-  /* Special code for when the divisor < BASE.  */
-  if (hden == 0 && lden < (unsigned HOST_WIDE_INT) BASE)
-    {
-      /* hnum != 0 already checked.  */
-      for (i = 4 - 1; i >= 0; i--)
-       {
-         work = num[i] + carry * BASE;
-         quo[i] = work / lden;
-         carry = work % lden;
-       }
-    }
-  else
-    {
-      /* Full double precision division,
-        with thanks to Don Knuth's "Seminumerical Algorithms".  */
-      int num_hi_sig, den_hi_sig;
-      unsigned HOST_WIDE_INT quo_est, scale;
-
-      /* Find the highest nonzero divisor digit.  */
-      for (i = 4 - 1;; i--)
-       if (den[i] != 0)
-         {
-           den_hi_sig = i;
-           break;
-         }
-
-      /* Insure that the first digit of the divisor is at least BASE/2.
-        This is required by the quotient digit estimation algorithm.  */
-
-      scale = BASE / (den[den_hi_sig] + 1);
-      if (scale > 1)
-       {               /* scale divisor and dividend */
-         carry = 0;
-         for (i = 0; i <= 4 - 1; i++)
-           {
-             work = (num[i] * scale) + carry;
-             num[i] = LOWPART (work);
-             carry = HIGHPART (work);
-           }
-
-         num[4] = carry;
-         carry = 0;
-         for (i = 0; i <= 4 - 1; i++)
-           {
-             work = (den[i] * scale) + carry;
-             den[i] = LOWPART (work);
-             carry = HIGHPART (work);
-             if (den[i] != 0) den_hi_sig = i;
-           }
-       }
-
-      num_hi_sig = 4;
-
-      /* Main loop */
-      for (i = num_hi_sig - den_hi_sig - 1; i >= 0; i--)
-       {
-         /* Guess the next quotient digit, quo_est, by dividing the first
-            two remaining dividend digits by the high order quotient digit.
-            quo_est is never low and is at most 2 high.  */
-         unsigned HOST_WIDE_INT tmp;
-
-         num_hi_sig = i + den_hi_sig + 1;
-         work = num[num_hi_sig] * BASE + num[num_hi_sig - 1];
-         if (num[num_hi_sig] != den[den_hi_sig])
-           quo_est = work / den[den_hi_sig];
-         else
-           quo_est = BASE - 1;
-
-         /* Refine quo_est so it's usually correct, and at most one high.  */
-         tmp = work - quo_est * den[den_hi_sig];
-         if (tmp < BASE
-             && (den[den_hi_sig - 1] * quo_est
-                 > (tmp * BASE + num[num_hi_sig - 2])))
-           quo_est--;
-
-         /* Try QUO_EST as the quotient digit, by multiplying the
-            divisor by QUO_EST and subtracting from the remaining dividend.
-            Keep in mind that QUO_EST is the I - 1st digit.  */
-
-         carry = 0;
-         for (j = 0; j <= den_hi_sig; j++)
-           {
-             work = quo_est * den[j] + carry;
-             carry = HIGHPART (work);
-             work = num[i + j] - LOWPART (work);
-             num[i + j] = LOWPART (work);
-             carry += HIGHPART (work) != 0;
-           }
-
-         /* If quo_est was high by one, then num[i] went negative and
-            we need to correct things.  */
-         if (num[num_hi_sig] < (HOST_WIDE_INT) carry)
-           {
-             quo_est--;
-             carry = 0;                /* add divisor back in */
-             for (j = 0; j <= den_hi_sig; j++)
-               {
-                 work = num[i + j] + den[j] + carry;
-                 carry = HIGHPART (work);
-                 num[i + j] = LOWPART (work);
-               }
-
-             num [num_hi_sig] += carry;
-           }
-
-         /* Store the quotient digit.  */
-         quo[i] = quo_est;
-       }
-    }
-
-  decode (quo, lquo, hquo);
-
- finish_up:
-  /* If result is negative, make it so.  */
-  if (quo_neg)
-    neg_double (*lquo, *hquo, lquo, hquo);
-
-  /* Compute trial remainder:  rem = num - (quo * den)  */
-  mul_double (*lquo, *hquo, lden_orig, hden_orig, lrem, hrem);
-  neg_double (*lrem, *hrem, lrem, hrem);
-  add_double (lnum_orig, hnum_orig, *lrem, *hrem, lrem, hrem);
-
-  switch (code)
-    {
-    case TRUNC_DIV_EXPR:
-    case TRUNC_MOD_EXPR:       /* round toward zero */
-    case EXACT_DIV_EXPR:       /* for this one, it shouldn't matter */
-      return overflow;
-
-    case FLOOR_DIV_EXPR:
-    case FLOOR_MOD_EXPR:       /* round toward negative infinity */
-      if (quo_neg && (*lrem != 0 || *hrem != 0))   /* ratio < 0 && rem != 0 */
-       {
-         /* quo = quo - 1;  */
-         add_double (*lquo, *hquo, (HOST_WIDE_INT) -1, (HOST_WIDE_INT)  -1,
-                     lquo, hquo);
-       }
-      else
-       return overflow;
-      break;
-
-    case CEIL_DIV_EXPR:
-    case CEIL_MOD_EXPR:                /* round toward positive infinity */
-      if (!quo_neg && (*lrem != 0 || *hrem != 0))  /* ratio > 0 && rem != 0 */
-       {
-         add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0,
-                     lquo, hquo);
-       }
-      else
-       return overflow;
-      break;
-
-    case ROUND_DIV_EXPR:
-    case ROUND_MOD_EXPR:       /* round to closest integer */
-      {
-       unsigned HOST_WIDE_INT labs_rem = *lrem;
-       HOST_WIDE_INT habs_rem = *hrem;
-       unsigned HOST_WIDE_INT labs_den = lden, ltwice;
-       HOST_WIDE_INT habs_den = hden, htwice;
-
-       /* Get absolute values.  */
-       if (*hrem < 0)
-         neg_double (*lrem, *hrem, &labs_rem, &habs_rem);
-       if (hden < 0)
-         neg_double (lden, hden, &labs_den, &habs_den);
-
-       /* If (2 * abs (lrem) >= abs (lden)), adjust the quotient.  */
-       mul_double ((HOST_WIDE_INT) 2, (HOST_WIDE_INT) 0,
-                   labs_rem, habs_rem, &ltwice, &htwice);
-
-       if (((unsigned HOST_WIDE_INT) habs_den
-            < (unsigned HOST_WIDE_INT) htwice)
-           || (((unsigned HOST_WIDE_INT) habs_den
-                == (unsigned HOST_WIDE_INT) htwice)
-               && (labs_den <= ltwice)))
-         {
-           if (*hquo < 0)
-             /* quo = quo - 1;  */
-             add_double (*lquo, *hquo,
-                         (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo);
-           else
-             /* quo = quo + 1; */
-             add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0,
-                         lquo, hquo);
-         }
-       else
-         return overflow;
-      }
-      break;
-
-    default:
-      gcc_unreachable ();
-    }
-
-  /* Compute true remainder:  rem = num - (quo * den)  */
-  mul_double (*lquo, *hquo, lden_orig, hden_orig, lrem, hrem);
-  neg_double (*lrem, *hrem, lrem, hrem);
-  add_double (lnum_orig, hnum_orig, *lrem, *hrem, lrem, hrem);
-  return overflow;
-}
-
-
 /* Returns mask for PREC bits.  */
 
 double_int
@@ -842,6 +107,18 @@ double_int_sext (double_int cst, unsigned prec)
   return r;
 }
 
+/* Constructs long integer from tree CST.  The extra bits over the precision of
+   the number are filled with sign bit if CST is signed, and with zeros if it
+   is unsigned.  */
+
+double_int
+tree_to_double_int (const_tree cst)
+{
+  /* We do not need to call double_int_restrict here to ensure the semantics as
+     described, as this is the default one for trees.  */
+  return TREE_INT_CST (cst);
+}
+
 /* Returns true if CST fits in unsigned HOST_WIDE_INT.  */
 
 bool
@@ -934,7 +211,7 @@ double_int_divmod (double_int a, double_int b, bool uns, unsigned code,
 {
   double_int ret;
 
-  div_and_round_double (code, uns, a.low, a.high,
+  div_and_round_double ((enum tree_code) code, uns, a.low, a.high,
                        b.low, b.high, &ret.low, &ret.high,
                        &mod->low, &mod->high);
   return ret;
@@ -1013,18 +290,6 @@ double_int_umod (double_int a, double_int b, unsigned code)
   return double_int_mod (a, b, true, code);
 }
 
-/* Set BITPOS bit in A.  */
-double_int
-double_int_setbit (double_int a, unsigned bitpos)
-{
-  if (bitpos < HOST_BITS_PER_WIDE_INT)
-    a.low |= (unsigned HOST_WIDE_INT) 1 << bitpos;
-  else
-    a.high |= (HOST_WIDE_INT) 1 <<  (bitpos - HOST_BITS_PER_WIDE_INT);
-  return a;
-}
-
 /* Shift A left by COUNT places keeping only PREC bits of result.  Shift
    right if COUNT is negative.  ARITH true specifies arithmetic shifting;
    otherwise use logical shift.  */
@@ -1049,6 +314,30 @@ double_int_rshift (double_int a, HOST_WIDE_INT count, unsigned int prec, bool ar
   return ret;
 }
 
+/* Constructs tree in type TYPE from with value given by CST.  Signedness of CST
+   is assumed to be the same as the signedness of TYPE.  */
+
+tree
+double_int_to_tree (tree type, double_int cst)
+{
+  cst = double_int_ext (cst, TYPE_PRECISION (type), TYPE_UNSIGNED (type));
+
+  return build_int_cst_wide (type, cst.low, cst.high);
+}
+
+/* Returns true if CST fits into range of TYPE.  Signedness of CST is assumed
+   to be the same as the signedness of TYPE.  */
+
+bool
+double_int_fits_to_tree_p (const_tree type, double_int cst)
+{
+  double_int ext = double_int_ext (cst,
+                                  TYPE_PRECISION (type),
+                                  TYPE_UNSIGNED (type));
+
+  return double_int_equal_p (cst, ext);
+}
+
 /* Returns -1 if A < B, 0 if A == B and 1 if A > B.  Signedness of the
    comparison is given by UNS.  */
 
index 370f619..30e32fc 100644 (file)
@@ -59,8 +59,14 @@ typedef struct
 
 #define HOST_BITS_PER_DOUBLE_INT (2 * HOST_BITS_PER_WIDE_INT)
 
+union tree_node;
+
 /* Constructors and conversions.  */
 
+union tree_node *double_int_to_tree (union tree_node *, double_int);
+bool double_int_fits_to_tree_p (const union tree_node *, double_int);
+double_int tree_to_double_int (const union tree_node *);
+
 /* Constructs double_int from integer CST.  The bits over the precision of
    HOST_WIDE_INT are filled with the sign bit.  */
 
@@ -123,12 +129,8 @@ double_int double_int_umod (double_int, double_int, unsigned);
 double_int double_int_divmod (double_int, double_int, bool, unsigned, double_int *);
 double_int double_int_sdivmod (double_int, double_int, unsigned, double_int *);
 double_int double_int_udivmod (double_int, double_int, unsigned, double_int *);
-double_int double_int_setbit (double_int, unsigned);
 
 /* Logical operations.  */
-
-/* Returns ~A.  */
-
 static inline double_int
 double_int_not (double_int a)
 {
@@ -137,16 +139,6 @@ double_int_not (double_int a)
   return a;
 }
 
-/* Returns A | B.  */
-
-static inline double_int
-double_int_ior (double_int a, double_int b)
-{
-  a.low |= b.low;
-  a.high |= b.high;
-  return a;
-}
-
 /* Shift operations.  */
 double_int double_int_lshift (double_int, HOST_WIDE_INT, unsigned int, bool);
 double_int double_int_rshift (double_int, HOST_WIDE_INT, unsigned int, bool);
@@ -210,47 +202,6 @@ double_int_equal_p (double_int cst1, double_int cst2)
   return cst1.low == cst2.low && cst1.high == cst2.high;
 }
 
-
-/* Legacy interface with decomposed high/low parts.  */
-
-extern tree force_fit_type_double (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                                  int, bool);
-extern int fit_double_type (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                           unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
-                           const_tree);
-extern int add_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                                unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                                unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
-                                bool);
-#define add_double(l1,h1,l2,h2,lv,hv) \
-  add_double_with_sign (l1, h1, l2, h2, lv, hv, false)
-extern int neg_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                      unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
-extern int mul_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                                unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                                unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
-                                bool);
-#define mul_double(l1,h1,l2,h2,lv,hv) \
-  mul_double_with_sign (l1, h1, l2, h2, lv, hv, false)
-extern void lshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                          HOST_WIDE_INT, unsigned int,
-                          unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, bool);
-extern void rshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                          HOST_WIDE_INT, unsigned int,
-                          unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, bool);
-extern void lrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                           HOST_WIDE_INT, unsigned int,
-                           unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
-extern void rrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
-                           HOST_WIDE_INT, unsigned int,
-                           unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
-extern int div_and_round_double (unsigned, int, unsigned HOST_WIDE_INT,
-                                HOST_WIDE_INT, unsigned HOST_WIDE_INT,
-                                HOST_WIDE_INT, unsigned HOST_WIDE_INT *,
-                                HOST_WIDE_INT *, unsigned HOST_WIDE_INT *,
-                                HOST_WIDE_INT *);
-
-
 #ifndef GENERATOR_FILE
 /* Conversion to and from GMP integer representations.  */
 
index 017e208..44de4a6 100644 (file)
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "insn-config.h"
 #include "expr.h"
 #include "optabs.h"
+#include "real.h"
 #include "recog.h"
 #include "langhooks.h"
 #include "df.h"
@@ -1846,7 +1847,7 @@ mask_rtx (enum machine_mode mode, int bitpos, int bitsize, int complement)
   if (complement)
     mask = double_int_not (mask);
 
-  return immed_double_int_const (mask, mode);
+  return immed_double_const (mask.low, mask.high, mode);
 }
 
 /* Return a constant integer (CONST_INT or CONST_DOUBLE) rtx with the value
@@ -1860,7 +1861,7 @@ lshift_value (enum machine_mode mode, rtx value, int bitpos, int bitsize)
   val = double_int_zext (uhwi_to_double_int (INTVAL (value)), bitsize);
   val = double_int_lshift (val, bitpos, HOST_BITS_PER_DOUBLE_INT, false);
 
-  return immed_double_int_const (val, mode);
+  return immed_double_const (val.low, val.high, mode);
 }
 \f
 /* Extract a bit field that is split across two words
@@ -3216,55 +3217,6 @@ expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target,
   gcc_assert (op0);
   return op0;
 }
-
-/* Perform a widening multiplication and return an rtx for the result.
-   MODE is mode of value; OP0 and OP1 are what to multiply (rtx's);
-   TARGET is a suggestion for where to store the result (an rtx).
-   THIS_OPTAB is the optab we should use, it must be either umul_widen_optab
-   or smul_widen_optab.
-
-   We check specially for a constant integer as OP1, comparing the
-   cost of a widening multiply against the cost of a sequence of shifts
-   and adds.  */
-
-rtx
-expand_widening_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target,
-                     int unsignedp, optab this_optab)
-{
-  bool speed = optimize_insn_for_speed_p ();
-
-  if (CONST_INT_P (op1)
-      && (INTVAL (op1) >= 0
-         || GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT))
-    {
-      HOST_WIDE_INT coeff = INTVAL (op1);
-      int max_cost;
-      enum mult_variant variant;
-      struct algorithm algorithm;
-
-      /* Special case powers of two.  */
-      if (EXACT_POWER_OF_2_OR_ZERO_P (coeff))
-       {
-         op0 = convert_to_mode (mode, op0, this_optab == umul_widen_optab);
-         return expand_shift (LSHIFT_EXPR, mode, op0,
-                              build_int_cst (NULL_TREE, floor_log2 (coeff)),
-                              target, unsignedp);
-       }
-
-      /* Exclude cost of op0 from max_cost to match the cost
-        calculation of the synth_mult.  */
-      max_cost = mul_widen_cost[speed][mode];
-      if (choose_mult_variant (mode, coeff, &algorithm, &variant,
-                              max_cost))
-       {
-         op0 = convert_to_mode (mode, op0, this_optab == umul_widen_optab);
-         return expand_mult_const (mode, op0, coeff, target,
-                                   &algorithm, variant);
-       }
-    }
-  return expand_binop (mode, this_optab, op0, op1, target,
-                      unsignedp, OPTAB_LIB_WIDEN);
-}
 \f
 /* Return the smallest n such that 2**n >= X.  */
 
index 17672ad..c3fcaa5 100644 (file)
@@ -53,7 +53,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "flags.h"
 #include "tree.h"
-#include "realmpfr.h"
+#include "real.h"
+#include "fixed-value.h"
 #include "rtl.h"
 #include "expr.h"
 #include "tm_p.h"
@@ -92,6 +93,8 @@ enum comparison_code {
   COMPCODE_TRUE = 15
 };
 
+static void encode (HOST_WIDE_INT *, unsigned HOST_WIDE_INT, HOST_WIDE_INT);
+static void decode (HOST_WIDE_INT *, unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
 static bool negate_mathfn_p (enum built_in_function);
 static bool negate_expr_p (tree);
 static tree negate_expr (tree);
@@ -156,6 +159,721 @@ static tree fold_convert_const (enum tree_code, tree, tree);
    sign.  */
 #define OVERFLOW_SUM_SIGN(a, b, sum) ((~((a) ^ (b)) & ((a) ^ (sum))) < 0)
 \f
+/* To do constant folding on INTEGER_CST nodes requires two-word arithmetic.
+   We do that by representing the two-word integer in 4 words, with only
+   HOST_BITS_PER_WIDE_INT / 2 bits stored in each word, as a positive
+   number.  The value of the word is LOWPART + HIGHPART * BASE.  */
+
+#define LOWPART(x) \
+  ((x) & (((unsigned HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) - 1))
+#define HIGHPART(x) \
+  ((unsigned HOST_WIDE_INT) (x) >> HOST_BITS_PER_WIDE_INT / 2)
+#define BASE ((unsigned HOST_WIDE_INT) 1 << HOST_BITS_PER_WIDE_INT / 2)
+
+/* Unpack a two-word integer into 4 words.
+   LOW and HI are the integer, as two `HOST_WIDE_INT' pieces.
+   WORDS points to the array of HOST_WIDE_INTs.  */
+
+static void
+encode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT low, HOST_WIDE_INT hi)
+{
+  words[0] = LOWPART (low);
+  words[1] = HIGHPART (low);
+  words[2] = LOWPART (hi);
+  words[3] = HIGHPART (hi);
+}
+
+/* Pack an array of 4 words into a two-word integer.
+   WORDS points to the array of words.
+   The integer is stored into *LOW and *HI as two `HOST_WIDE_INT' pieces.  */
+
+static void
+decode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT *low,
+       HOST_WIDE_INT *hi)
+{
+  *low = words[0] + words[1] * BASE;
+  *hi = words[2] + words[3] * BASE;
+}
+\f
+/* Force the double-word integer L1, H1 to be within the range of the
+   integer type TYPE.  Stores the properly truncated and sign-extended
+   double-word integer in *LV, *HV.  Returns true if the operation
+   overflows, that is, argument and result are different.  */
+
+int
+fit_double_type (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+                unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, const_tree type)
+{
+  unsigned HOST_WIDE_INT low0 = l1;
+  HOST_WIDE_INT high0 = h1;
+  unsigned int prec = TYPE_PRECISION (type);
+  int sign_extended_type;
+
+  /* Size types *are* sign extended.  */
+  sign_extended_type = (!TYPE_UNSIGNED (type)
+                       || (TREE_CODE (type) == INTEGER_TYPE
+                           && TYPE_IS_SIZETYPE (type)));
+
+  /* First clear all bits that are beyond the type's precision.  */
+  if (prec >= 2 * HOST_BITS_PER_WIDE_INT)
+    ;
+  else if (prec > HOST_BITS_PER_WIDE_INT)
+    h1 &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT));
+  else
+    {
+      h1 = 0;
+      if (prec < HOST_BITS_PER_WIDE_INT)
+       l1 &= ~((HOST_WIDE_INT) (-1) << prec);
+    }
+
+  /* Then do sign extension if necessary.  */
+  if (!sign_extended_type)
+    /* No sign extension */;
+  else if (prec >= 2 * HOST_BITS_PER_WIDE_INT)
+    /* Correct width already.  */;
+  else if (prec > HOST_BITS_PER_WIDE_INT)
+    {
+      /* Sign extend top half? */
+      if (h1 & ((unsigned HOST_WIDE_INT)1
+               << (prec - HOST_BITS_PER_WIDE_INT - 1)))
+       h1 |= (HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT);
+    }
+  else if (prec == HOST_BITS_PER_WIDE_INT)
+    {
+      if ((HOST_WIDE_INT)l1 < 0)
+       h1 = -1;
+    }
+  else
+    {
+      /* Sign extend bottom half? */
+      if (l1 & ((unsigned HOST_WIDE_INT)1 << (prec - 1)))
+       {
+         h1 = -1;
+         l1 |= (HOST_WIDE_INT)(-1) << prec;
+       }
+    }
+
+  *lv = l1;
+  *hv = h1;
+
+  /* If the value didn't fit, signal overflow.  */
+  return l1 != low0 || h1 != high0;
+}
+
+/* We force the double-int HIGH:LOW to the range of the type TYPE by
+   sign or zero extending it.
+   OVERFLOWABLE indicates if we are interested
+   in overflow of the value, when >0 we are only interested in signed
+   overflow, for <0 we are interested in any overflow.  OVERFLOWED
+   indicates whether overflow has already occurred.  CONST_OVERFLOWED
+   indicates whether constant overflow has already occurred.  We force
+   T's value to be within range of T's type (by setting to 0 or 1 all
+   the bits outside the type's range).  We set TREE_OVERFLOWED if,
+       OVERFLOWED is nonzero,
+       or OVERFLOWABLE is >0 and signed overflow occurs
+       or OVERFLOWABLE is <0 and any overflow occurs
+   We return a new tree node for the extended double-int.  The node
+   is shared if no overflow flags are set.  */
+
+tree
+force_fit_type_double (tree type, unsigned HOST_WIDE_INT low,
+                      HOST_WIDE_INT high, int overflowable,
+                      bool overflowed)
+{
+  int sign_extended_type;
+  bool overflow;
+
+  /* Size types *are* sign extended.  */
+  sign_extended_type = (!TYPE_UNSIGNED (type)
+                       || (TREE_CODE (type) == INTEGER_TYPE
+                           && TYPE_IS_SIZETYPE (type)));
+
+  overflow = fit_double_type (low, high, &low, &high, type);
+
+  /* If we need to set overflow flags, return a new unshared node.  */
+  if (overflowed || overflow)
+    {
+      if (overflowed
+         || overflowable < 0
+         || (overflowable > 0 && sign_extended_type))
+       {
+          tree t = make_node (INTEGER_CST);
+          TREE_INT_CST_LOW (t) = low;
+          TREE_INT_CST_HIGH (t) = high;
+          TREE_TYPE (t) = type;
+         TREE_OVERFLOW (t) = 1;
+         return t;
+       }
+    }
+
+  /* Else build a shared node.  */
+  return build_int_cst_wide (type, low, high);
+}
+\f
+/* Add two doubleword integers with doubleword result.
+   Return nonzero if the operation overflows according to UNSIGNED_P.
+   Each argument is given as two `HOST_WIDE_INT' pieces.
+   One argument is L1 and H1; the other, L2 and H2.
+   The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
+
+int
+add_double_with_sign (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+                     unsigned HOST_WIDE_INT l2, HOST_WIDE_INT h2,
+                     unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv,
+                     bool unsigned_p)
+{
+  unsigned HOST_WIDE_INT l;
+  HOST_WIDE_INT h;
+
+  l = l1 + l2;
+  h = (HOST_WIDE_INT) ((unsigned HOST_WIDE_INT) h1
+                      + (unsigned HOST_WIDE_INT) h2
+                      + (l < l1));
+
+  *lv = l;
+  *hv = h;
+
+  if (unsigned_p)
+    return ((unsigned HOST_WIDE_INT) h < (unsigned HOST_WIDE_INT) h1
+           || (h == h1
+               && l < l1));
+  else
+    return OVERFLOW_SUM_SIGN (h1, h2, h);
+}
+
+/* Negate a doubleword integer with doubleword result.
+   Return nonzero if the operation overflows, assuming it's signed.
+   The argument is given as two `HOST_WIDE_INT' pieces in L1 and H1.
+   The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
+
+int
+neg_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+           unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
+{
+  if (l1 == 0)
+    {
+      *lv = 0;
+      *hv = - h1;
+      return (*hv & h1) < 0;
+    }
+  else
+    {
+      *lv = -l1;
+      *hv = ~h1;
+      return 0;
+    }
+}
+\f
+/* Multiply two doubleword integers with doubleword result.
+   Return nonzero if the operation overflows according to UNSIGNED_P.
+   Each argument is given as two `HOST_WIDE_INT' pieces.
+   One argument is L1 and H1; the other, L2 and H2.
+   The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
+
+int
+mul_double_with_sign (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+                     unsigned HOST_WIDE_INT l2, HOST_WIDE_INT h2,
+                     unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv,
+                     bool unsigned_p)
+{
+  HOST_WIDE_INT arg1[4];
+  HOST_WIDE_INT arg2[4];
+  HOST_WIDE_INT prod[4 * 2];
+  unsigned HOST_WIDE_INT carry;
+  int i, j, k;
+  unsigned HOST_WIDE_INT toplow, neglow;
+  HOST_WIDE_INT tophigh, neghigh;
+
+  encode (arg1, l1, h1);
+  encode (arg2, l2, h2);
+
+  memset (prod, 0, sizeof prod);
+
+  for (i = 0; i < 4; i++)
+    {
+      carry = 0;
+      for (j = 0; j < 4; j++)
+       {
+         k = i + j;
+         /* This product is <= 0xFFFE0001, the sum <= 0xFFFF0000.  */
+         carry += arg1[i] * arg2[j];
+         /* Since prod[p] < 0xFFFF, this sum <= 0xFFFFFFFF.  */
+         carry += prod[k];
+         prod[k] = LOWPART (carry);
+         carry = HIGHPART (carry);
+       }
+      prod[i + 4] = carry;
+    }
+
+  decode (prod, lv, hv);
+  decode (prod + 4, &toplow, &tophigh);
+
+  /* Unsigned overflow is immediate.  */
+  if (unsigned_p)
+    return (toplow | tophigh) != 0;
+
+  /* Check for signed overflow by calculating the signed representation of the
+     top half of the result; it should agree with the low half's sign bit.  */
+  if (h1 < 0)
+    {
+      neg_double (l2, h2, &neglow, &neghigh);
+      add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh);
+    }
+  if (h2 < 0)
+    {
+      neg_double (l1, h1, &neglow, &neghigh);
+      add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh);
+    }
+  return (*hv < 0 ? ~(toplow & tophigh) : toplow | tophigh) != 0;
+}
+\f
+/* Shift the doubleword integer in L1, H1 left by COUNT places
+   keeping only PREC bits of result.
+   Shift right if COUNT is negative.
+   ARITH nonzero specifies arithmetic shifting; otherwise use logical shift.
+   Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
+
+void
+lshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+              HOST_WIDE_INT count, unsigned int prec,
+              unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, bool arith)
+{
+  unsigned HOST_WIDE_INT signmask;
+
+  if (count < 0)
+    {
+      rshift_double (l1, h1, -count, prec, lv, hv, arith);
+      return;
+    }
+
+  if (SHIFT_COUNT_TRUNCATED)
+    count %= prec;
+
+  if (count >= 2 * HOST_BITS_PER_WIDE_INT)
+    {
+      /* Shifting by the host word size is undefined according to the
+        ANSI standard, so we must handle this as a special case.  */
+      *hv = 0;
+      *lv = 0;
+    }
+  else if (count >= HOST_BITS_PER_WIDE_INT)
+    {
+      *hv = l1 << (count - HOST_BITS_PER_WIDE_INT);
+      *lv = 0;
+    }
+  else
+    {
+      *hv = (((unsigned HOST_WIDE_INT) h1 << count)
+            | (l1 >> (HOST_BITS_PER_WIDE_INT - count - 1) >> 1));
+      *lv = l1 << count;
+    }
+
+  /* Sign extend all bits that are beyond the precision.  */
+
+  signmask = -((prec > HOST_BITS_PER_WIDE_INT
+               ? ((unsigned HOST_WIDE_INT) *hv
+                  >> (prec - HOST_BITS_PER_WIDE_INT - 1))
+               : (*lv >> (prec - 1))) & 1);
+
+  if (prec >= 2 * HOST_BITS_PER_WIDE_INT)
+    ;
+  else if (prec >= HOST_BITS_PER_WIDE_INT)
+    {
+      *hv &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT));
+      *hv |= signmask << (prec - HOST_BITS_PER_WIDE_INT);
+    }
+  else
+    {
+      *hv = signmask;
+      *lv &= ~((unsigned HOST_WIDE_INT) (-1) << prec);
+      *lv |= signmask << prec;
+    }
+}
+
+/* Shift the doubleword integer in L1, H1 right by COUNT places
+   keeping only PREC bits of result.  Shift left if COUNT is negative.
+   ARITH nonzero specifies arithmetic shifting; otherwise use logical shift.
+   Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
+
+void
+rshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+              HOST_WIDE_INT count, unsigned int prec,
+              unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv,
+              bool arith)
+{
+  unsigned HOST_WIDE_INT signmask;
+
+  signmask = (arith
+             ? -((unsigned HOST_WIDE_INT) h1 >> (HOST_BITS_PER_WIDE_INT - 1))
+             : 0);
+
+  if (SHIFT_COUNT_TRUNCATED)
+    count %= prec;
+
+  if (count >= 2 * HOST_BITS_PER_WIDE_INT)
+    {
+      /* Shifting by the host word size is undefined according to the
+        ANSI standard, so we must handle this as a special case.  */
+      *hv = 0;
+      *lv = 0;
+    }
+  else if (count >= HOST_BITS_PER_WIDE_INT)
+    {
+      *hv = 0;
+      *lv = (unsigned HOST_WIDE_INT) h1 >> (count - HOST_BITS_PER_WIDE_INT);
+    }
+  else
+    {
+      *hv = (unsigned HOST_WIDE_INT) h1 >> count;
+      *lv = ((l1 >> count)
+            | ((unsigned HOST_WIDE_INT) h1 << (HOST_BITS_PER_WIDE_INT - count - 1) << 1));
+    }
+
+  /* Zero / sign extend all bits that are beyond the precision.  */
+
+  if (count >= (HOST_WIDE_INT)prec)
+    {
+      *hv = signmask;
+      *lv = signmask;
+    }
+  else if ((prec - count) >= 2 * HOST_BITS_PER_WIDE_INT)
+    ;
+  else if ((prec - count) >= HOST_BITS_PER_WIDE_INT)
+    {
+      *hv &= ~((HOST_WIDE_INT) (-1) << (prec - count - HOST_BITS_PER_WIDE_INT));
+      *hv |= signmask << (prec - count - HOST_BITS_PER_WIDE_INT);
+    }
+  else
+    {
+      *hv = signmask;
+      *lv &= ~((unsigned HOST_WIDE_INT) (-1) << (prec - count));
+      *lv |= signmask << (prec - count);
+    }
+}
+\f
+/* Rotate the doubleword integer in L1, H1 left by COUNT places
+   keeping only PREC bits of result.
+   Rotate right if COUNT is negative.
+   Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
+
+void
+lrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+               HOST_WIDE_INT count, unsigned int prec,
+               unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
+{
+  unsigned HOST_WIDE_INT s1l, s2l;
+  HOST_WIDE_INT s1h, s2h;
+
+  count %= prec;
+  if (count < 0)
+    count += prec;
+
+  lshift_double (l1, h1, count, prec, &s1l, &s1h, 0);
+  rshift_double (l1, h1, prec - count, prec, &s2l, &s2h, 0);
+  *lv = s1l | s2l;
+  *hv = s1h | s2h;
+}
+
+/* Rotate the doubleword integer in L1, H1 left by COUNT places
+   keeping only PREC bits of result.  COUNT must be positive.
+   Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV.  */
+
+void
+rrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+               HOST_WIDE_INT count, unsigned int prec,
+               unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
+{
+  unsigned HOST_WIDE_INT s1l, s2l;
+  HOST_WIDE_INT s1h, s2h;
+
+  count %= prec;
+  if (count < 0)
+    count += prec;
+
+  rshift_double (l1, h1, count, prec, &s1l, &s1h, 0);
+  lshift_double (l1, h1, prec - count, prec, &s2l, &s2h, 0);
+  *lv = s1l | s2l;
+  *hv = s1h | s2h;
+}
+\f
+/* Divide doubleword integer LNUM, HNUM by doubleword integer LDEN, HDEN
+   for a quotient (stored in *LQUO, *HQUO) and remainder (in *LREM, *HREM).
+   CODE is a tree code for a kind of division, one of
+   TRUNC_DIV_EXPR, FLOOR_DIV_EXPR, CEIL_DIV_EXPR, ROUND_DIV_EXPR
+   or EXACT_DIV_EXPR
+   It controls how the quotient is rounded to an integer.
+   Return nonzero if the operation overflows.
+   UNS nonzero says do unsigned division.  */
+
+int
+div_and_round_double (enum tree_code code, int uns,
+                     unsigned HOST_WIDE_INT lnum_orig, /* num == numerator == dividend */
+                     HOST_WIDE_INT hnum_orig,
+                     unsigned HOST_WIDE_INT lden_orig, /* den == denominator == divisor */
+                     HOST_WIDE_INT hden_orig,
+                     unsigned HOST_WIDE_INT *lquo,
+                     HOST_WIDE_INT *hquo, unsigned HOST_WIDE_INT *lrem,
+                     HOST_WIDE_INT *hrem)
+{
+  int quo_neg = 0;
+  HOST_WIDE_INT num[4 + 1];    /* extra element for scaling.  */
+  HOST_WIDE_INT den[4], quo[4];
+  int i, j;
+  unsigned HOST_WIDE_INT work;
+  unsigned HOST_WIDE_INT carry = 0;
+  unsigned HOST_WIDE_INT lnum = lnum_orig;
+  HOST_WIDE_INT hnum = hnum_orig;
+  unsigned HOST_WIDE_INT lden = lden_orig;
+  HOST_WIDE_INT hden = hden_orig;
+  int overflow = 0;
+
+  if (hden == 0 && lden == 0)
+    overflow = 1, lden = 1;
+
+  /* Calculate quotient sign and convert operands to unsigned.  */
+  if (!uns)
+    {
+      if (hnum < 0)
+       {
+         quo_neg = ~ quo_neg;
+         /* (minimum integer) / (-1) is the only overflow case.  */
+         if (neg_double (lnum, hnum, &lnum, &hnum)
+             && ((HOST_WIDE_INT) lden & hden) == -1)
+           overflow = 1;
+       }
+      if (hden < 0)
+       {
+         quo_neg = ~ quo_neg;
+         neg_double (lden, hden, &lden, &hden);
+       }
+    }
+
+  if (hnum == 0 && hden == 0)
+    {                          /* single precision */
+      *hquo = *hrem = 0;
+      /* This unsigned division rounds toward zero.  */
+      *lquo = lnum / lden;
+      goto finish_up;
+    }
+
+  if (hnum == 0)
+    {                          /* trivial case: dividend < divisor */
+      /* hden != 0 already checked.  */
+      *hquo = *lquo = 0;
+      *hrem = hnum;
+      *lrem = lnum;
+      goto finish_up;
+    }
+
+  memset (quo, 0, sizeof quo);
+
+  memset (num, 0, sizeof num); /* to zero 9th element */
+  memset (den, 0, sizeof den);
+
+  encode (num, lnum, hnum);
+  encode (den, lden, hden);
+
+  /* Special code for when the divisor < BASE.  */
+  if (hden == 0 && lden < (unsigned HOST_WIDE_INT) BASE)
+    {
+      /* hnum != 0 already checked.  */
+      for (i = 4 - 1; i >= 0; i--)
+       {
+         work = num[i] + carry * BASE;
+         quo[i] = work / lden;
+         carry = work % lden;
+       }
+    }
+  else
+    {
+      /* Full double precision division,
+        with thanks to Don Knuth's "Seminumerical Algorithms".  */
+      int num_hi_sig, den_hi_sig;
+      unsigned HOST_WIDE_INT quo_est, scale;
+
+      /* Find the highest nonzero divisor digit.  */
+      for (i = 4 - 1;; i--)
+       if (den[i] != 0)
+         {
+           den_hi_sig = i;
+           break;
+         }
+
+      /* Insure that the first digit of the divisor is at least BASE/2.
+        This is required by the quotient digit estimation algorithm.  */
+
+      scale = BASE / (den[den_hi_sig] + 1);
+      if (scale > 1)
+       {               /* scale divisor and dividend */
+         carry = 0;
+         for (i = 0; i <= 4 - 1; i++)
+           {
+             work = (num[i] * scale) + carry;
+             num[i] = LOWPART (work);
+             carry = HIGHPART (work);
+           }
+
+         num[4] = carry;
+         carry = 0;
+         for (i = 0; i <= 4 - 1; i++)
+           {
+             work = (den[i] * scale) + carry;
+             den[i] = LOWPART (work);
+             carry = HIGHPART (work);
+             if (den[i] != 0) den_hi_sig = i;
+           }
+       }
+
+      num_hi_sig = 4;
+
+      /* Main loop */
+      for (i = num_hi_sig - den_hi_sig - 1; i >= 0; i--)
+       {
+         /* Guess the next quotient digit, quo_est, by dividing the first
+            two remaining dividend digits by the high order quotient digit.
+            quo_est is never low and is at most 2 high.  */
+         unsigned HOST_WIDE_INT tmp;
+
+         num_hi_sig = i + den_hi_sig + 1;
+         work = num[num_hi_sig] * BASE + num[num_hi_sig - 1];
+         if (num[num_hi_sig] != den[den_hi_sig])
+           quo_est = work / den[den_hi_sig];
+         else
+           quo_est = BASE - 1;
+
+         /* Refine quo_est so it's usually correct, and at most one high.  */
+         tmp = work - quo_est * den[den_hi_sig];
+         if (tmp < BASE
+             && (den[den_hi_sig - 1] * quo_est
+                 > (tmp * BASE + num[num_hi_sig - 2])))
+           quo_est--;
+
+         /* Try QUO_EST as the quotient digit, by multiplying the
+            divisor by QUO_EST and subtracting from the remaining dividend.
+            Keep in mind that QUO_EST is the I - 1st digit.  */
+
+         carry = 0;
+         for (j = 0; j <= den_hi_sig; j++)
+           {
+             work = quo_est * den[j] + carry;
+             carry = HIGHPART (work);
+             work = num[i + j] - LOWPART (work);
+             num[i + j] = LOWPART (work);
+             carry += HIGHPART (work) != 0;
+           }
+
+         /* If quo_est was high by one, then num[i] went negative and
+            we need to correct things.  */
+         if (num[num_hi_sig] < (HOST_WIDE_INT) carry)
+           {
+             quo_est--;
+             carry = 0;                /* add divisor back in */
+             for (j = 0; j <= den_hi_sig; j++)
+               {
+                 work = num[i + j] + den[j] + carry;
+                 carry = HIGHPART (work);
+                 num[i + j] = LOWPART (work);
+               }
+
+             num [num_hi_sig] += carry;
+           }
+
+         /* Store the quotient digit.  */
+         quo[i] = quo_est;
+       }
+    }
+
+  decode (quo, lquo, hquo);
+
+ finish_up:
+  /* If result is negative, make it so.  */
+  if (quo_neg)
+    neg_double (*lquo, *hquo, lquo, hquo);
+
+  /* Compute trial remainder:  rem = num - (quo * den)  */
+  mul_double (*lquo, *hquo, lden_orig, hden_orig, lrem, hrem);
+  neg_double (*lrem, *hrem, lrem, hrem);
+  add_double (lnum_orig, hnum_orig, *lrem, *hrem, lrem, hrem);
+
+  switch (code)
+    {
+    case TRUNC_DIV_EXPR:
+    case TRUNC_MOD_EXPR:       /* round toward zero */
+    case EXACT_DIV_EXPR:       /* for this one, it shouldn't matter */
+      return overflow;
+
+    case FLOOR_DIV_EXPR:
+    case FLOOR_MOD_EXPR:       /* round toward negative infinity */
+      if (quo_neg && (*lrem != 0 || *hrem != 0))   /* ratio < 0 && rem != 0 */
+       {
+         /* quo = quo - 1;  */
+         add_double (*lquo, *hquo, (HOST_WIDE_INT) -1, (HOST_WIDE_INT)  -1,
+                     lquo, hquo);
+       }
+      else
+       return overflow;
+      break;
+
+    case CEIL_DIV_EXPR:
+    case CEIL_MOD_EXPR:                /* round toward positive infinity */
+      if (!quo_neg && (*lrem != 0 || *hrem != 0))  /* ratio > 0 && rem != 0 */
+       {
+         add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0,
+                     lquo, hquo);
+       }
+      else
+       return overflow;
+      break;
+
+    case ROUND_DIV_EXPR:
+    case ROUND_MOD_EXPR:       /* round to closest integer */
+      {
+       unsigned HOST_WIDE_INT labs_rem = *lrem;
+       HOST_WIDE_INT habs_rem = *hrem;
+       unsigned HOST_WIDE_INT labs_den = lden, ltwice;
+       HOST_WIDE_INT habs_den = hden, htwice;
+
+       /* Get absolute values.  */
+       if (*hrem < 0)
+         neg_double (*lrem, *hrem, &labs_rem, &habs_rem);
+       if (hden < 0)
+         neg_double (lden, hden, &labs_den, &habs_den);
+
+       /* If (2 * abs (lrem) >= abs (lden)), adjust the quotient.  */
+       mul_double ((HOST_WIDE_INT) 2, (HOST_WIDE_INT) 0,
+                   labs_rem, habs_rem, &ltwice, &htwice);
+
+       if (((unsigned HOST_WIDE_INT) habs_den
+            < (unsigned HOST_WIDE_INT) htwice)
+           || (((unsigned HOST_WIDE_INT) habs_den
+                == (unsigned HOST_WIDE_INT) htwice)
+               && (labs_den <= ltwice)))
+         {
+           if (*hquo < 0)
+             /* quo = quo - 1;  */
+             add_double (*lquo, *hquo,
+                         (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo);
+           else
+             /* quo = quo + 1; */
+             add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0,
+                         lquo, hquo);
+         }
+       else
+         return overflow;
+      }
+      break;
+
+    default:
+      gcc_unreachable ();
+    }
+
+  /* Compute true remainder:  rem = num - (quo * den)  */
+  mul_double (*lquo, *hquo, lden_orig, hden_orig, lrem, hrem);
+  neg_double (*lrem, *hrem, lrem, hrem);
+  add_double (lnum_orig, hnum_orig, *lrem, *hrem, lrem, hrem);
+  return overflow;
+}
+
 /* If ARG2 divides ARG1 with zero remainder, carries out the division
    of type CODE and returns the quotient.
    Otherwise returns NULL_TREE.  */
@@ -4996,76 +5714,6 @@ unextend (tree c, int p, int unsignedp, tree mask)
                       const_binop (BIT_XOR_EXPR, c, temp, 0));
 }
 \f
-/* For an expression that has the form
-     (A && B) || ~B
-   or
-     (A || B) && ~B,
-   we can drop one of the inner expressions and simplify to
-     A || ~B
-   or
-     A && ~B
-   LOC is the location of the resulting expression.  OP is the inner 
-   logical operation; the left-hand side in the examples above, while CMPOP
-   is the right-hand side.  RHS_ONLY is used to prevent us from accidentally
-   removing a condition that guards another, as in
-     (A != NULL && A->...) || A == NULL
-   which we must not transform.  If RHS_ONLY is true, only eliminate the
-   right-most operand of the inner logical operation.  */
-
-static tree
-merge_truthop_with_opposite_arm (location_t loc, tree op, tree cmpop,
-                                bool rhs_only)
-{
-  tree type = TREE_TYPE (cmpop);
-  enum tree_code code = TREE_CODE (cmpop);
-  enum tree_code truthop_code = TREE_CODE (op);
-  tree lhs = TREE_OPERAND (op, 0);
-  tree rhs = TREE_OPERAND (op, 1);
-  tree orig_lhs = lhs, orig_rhs = rhs;
-  enum tree_code rhs_code = TREE_CODE (rhs);
-  enum tree_code lhs_code = TREE_CODE (lhs);
-  enum tree_code inv_code;
-
-  if (TREE_SIDE_EFFECTS (op) || TREE_SIDE_EFFECTS (cmpop))
-    return NULL_TREE;
-
-  if (TREE_CODE_CLASS (code) != tcc_comparison)
-    return NULL_TREE;
-
-  if (rhs_code == truthop_code)
-    {
-      tree newrhs = merge_truthop_with_opposite_arm (loc, rhs, cmpop, rhs_only);
-      if (newrhs != NULL_TREE)
-       {
-         rhs = newrhs;
-         rhs_code = TREE_CODE (rhs);
-       }
-    }
-  if (lhs_code == truthop_code && !rhs_only)
-    {
-      tree newlhs = merge_truthop_with_opposite_arm (loc, lhs, cmpop, false);
-      if (newlhs != NULL_TREE)
-       {
-         lhs = newlhs;
-         lhs_code = TREE_CODE (lhs);
-       }
-    }
-
-  inv_code = invert_tree_comparison (code, HONOR_NANS (TYPE_MODE (type)));
-  if (inv_code == rhs_code
-      && operand_equal_p (TREE_OPERAND (rhs, 0), TREE_OPERAND (cmpop, 0), 0)
-      && operand_equal_p (TREE_OPERAND (rhs, 1), TREE_OPERAND (cmpop, 1), 0))
-    return lhs;
-  if (!rhs_only && inv_code == lhs_code
-      && operand_equal_p (TREE_OPERAND (lhs, 0), TREE_OPERAND (cmpop, 0), 0)
-      && operand_equal_p (TREE_OPERAND (lhs, 1), TREE_OPERAND (cmpop, 1), 0))
-    return rhs;
-  if (rhs != orig_rhs || lhs != orig_lhs)
-    return fold_build2_loc (loc, truthop_code, TREE_TYPE (cmpop),
-                           lhs, rhs);
-  return NULL_TREE;
-}
-
 /* Find ways of folding logical expressions of LHS and RHS:
    Try to merge two comparisons to the same innermost item.
    Look for range tests like "ch >= '0' && ch <= '9'".
@@ -7407,14 +8055,13 @@ native_interpret_int (tree type, const unsigned char *ptr, int len)
   int total_bytes = GET_MODE_SIZE (TYPE_MODE (type));
   int byte, offset, word, words;
   unsigned char value;
-  double_int result;
+  unsigned int HOST_WIDE_INT lo = 0;
+  HOST_WIDE_INT hi = 0;
 
   if (total_bytes > len)
     return NULL_TREE;
   if (total_bytes * BITS_PER_UNIT > 2 * HOST_BITS_PER_WIDE_INT)
     return NULL_TREE;
-
-  result = double_int_zero;
   words = total_bytes / UNITS_PER_WORD;
 
   for (byte = 0; byte < total_bytes; byte++)
@@ -7436,13 +8083,13 @@ native_interpret_int (tree type, const unsigned char *ptr, int len)
       value = ptr[offset];
 
       if (bitpos < HOST_BITS_PER_WIDE_INT)
-       result.low |= (unsigned HOST_WIDE_INT) value << bitpos;
+       lo |= (unsigned HOST_WIDE_INT) value << bitpos;
       else
-       result.high |= (unsigned HOST_WIDE_INT) value
-                      << (bitpos - HOST_BITS_PER_WIDE_INT);
+       hi |= (unsigned HOST_WIDE_INT) value
+             << (bitpos - HOST_BITS_PER_WIDE_INT);
     }
 
-  return double_int_to_tree (type, result);
+  return build_int_cst_wide_type (type, lo, hi);
 }
 
 
@@ -8713,33 +9360,9 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
          offset1 = TREE_OPERAND (arg1, 1);
        }
 
-      /* A local variable can never be pointed to by
-         the default SSA name of an incoming parameter.  */
-      if ((TREE_CODE (arg0) == ADDR_EXPR
-           && indirect_base0
-           && TREE_CODE (base0) == VAR_DECL
-           && auto_var_in_fn_p (base0, current_function_decl)
-           && !indirect_base1
-           && TREE_CODE (base1) == SSA_NAME
-           && TREE_CODE (SSA_NAME_VAR (base1)) == PARM_DECL
-           && SSA_NAME_IS_DEFAULT_DEF (base1))
-          || (TREE_CODE (arg1) == ADDR_EXPR
-              && indirect_base1
-              && TREE_CODE (base1) == VAR_DECL
-              && auto_var_in_fn_p (base1, current_function_decl)
-              && !indirect_base0
-              && TREE_CODE (base0) == SSA_NAME
-              && TREE_CODE (SSA_NAME_VAR (base0)) == PARM_DECL
-              && SSA_NAME_IS_DEFAULT_DEF (base0)))
-        {
-          if (code == NE_EXPR)
-            return constant_boolean_node (1, type);
-          else if (code == EQ_EXPR)
-            return constant_boolean_node (0, type);
-        }
       /* If we have equivalent bases we might be able to simplify.  */
-      else if (indirect_base0 == indirect_base1
-               && operand_equal_p (base0, base1, 0))
+      if (indirect_base0 == indirect_base1
+         && operand_equal_p (base0, base1, 0))
        {
          /* We can fold this expression to a constant if the non-constant
             offset parts are equal.  */
@@ -8789,19 +9412,24 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
                   && ((code == EQ_EXPR || code == NE_EXPR)
                       || POINTER_TYPE_OVERFLOW_UNDEFINED))
            {
+             tree signed_size_type_node;
+             signed_size_type_node = signed_type_for (size_type_node);
+
              /* By converting to signed size type we cover middle-end pointer
                 arithmetic which operates on unsigned pointer types of size
                 type size and ARRAY_REF offsets which are properly sign or
                 zero extended from their type in case it is narrower than
                 size type.  */
              if (offset0 == NULL_TREE)
-               offset0 = build_int_cst (ssizetype, 0);
+               offset0 = build_int_cst (signed_size_type_node, 0);
              else
-               offset0 = fold_convert_loc (loc, ssizetype, offset0);
+               offset0 = fold_convert_loc (loc, signed_size_type_node,
+                                           offset0);
              if (offset1 == NULL_TREE)
-               offset1 = build_int_cst (ssizetype, 0);
+               offset1 = build_int_cst (signed_size_type_node, 0);
              else
-               offset1 = fold_convert_loc (loc, ssizetype, offset1);
+               offset1 = fold_convert_loc (loc, signed_size_type_node,
+                                           offset1);
 
              if (code != EQ_EXPR
                  && code != NE_EXPR
@@ -8978,7 +9606,7 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
            return fold_build2_loc (loc, swap_tree_comparison (code), type,
                                TREE_OPERAND (arg0, 0),
                                build_real (TREE_TYPE (arg1),
-                                           real_value_negate (&cst)));
+                                           REAL_VALUE_NEGATE (cst)));
 
          /* IEEE doesn't distinguish +0 and -0 in comparisons.  */
          /* a CMP (-0) -> a CMP 0  */
@@ -11903,22 +12531,6 @@ fold_binary_loc (location_t loc,
       if (0 != (tem = fold_range_test (loc, code, type, op0, op1)))
        return tem;
 
-      if ((code == TRUTH_ANDIF_EXPR && TREE_CODE (arg0) == TRUTH_ORIF_EXPR)
-         || (code == TRUTH_ORIF_EXPR && TREE_CODE (arg0) == TRUTH_ANDIF_EXPR))
-       {
-         tem = merge_truthop_with_opposite_arm (loc, arg0, arg1, true);
-         if (tem)
-           return fold_build2_loc (loc, code, type, tem, arg1);
-       }
-
-      if ((code == TRUTH_ANDIF_EXPR && TREE_CODE (arg1) == TRUTH_ORIF_EXPR)
-         || (code == TRUTH_ORIF_EXPR && TREE_CODE (arg1) == TRUTH_ANDIF_EXPR))
-       {
-         tem = merge_truthop_with_opposite_arm (loc, arg1, arg0, false);
-         if (tem)
-           return fold_build2_loc (loc, code, type, arg0, tem);
-       }
-
       /* Check for the possibility of merging component references.  If our
         lhs is another similar operation, try to merge its rhs with our
         rhs.  Then try to merge our lhs and rhs.  */
@@ -14917,9 +15529,7 @@ tree_single_nonzero_warnv_p (tree t, bool *strict_overflow_p)
 
     case ADDR_EXPR:
       {
-       tree base = TREE_OPERAND (t, 0);
-       if (!DECL_P (base))
-         base = get_base_address (base);
+       tree base = get_base_address (TREE_OPERAND (t, 0));
 
        if (!base)
          return false;
@@ -14929,9 +15539,7 @@ tree_single_nonzero_warnv_p (tree t, bool *strict_overflow_p)
           allocated on the stack.  */
        if (DECL_P (base)
            && (flag_delete_null_pointer_checks
-               || (DECL_CONTEXT (base)
-                   && TREE_CODE (DECL_CONTEXT (base)) == FUNCTION_DECL
-                   && auto_var_in_fn_p (base, DECL_CONTEXT (base)))))
+               || (TREE_CODE (base) == VAR_DECL && !TREE_STATIC (base))))
          return !VAR_OR_FUNCTION_DECL_P (base) || !DECL_WEAK (base);
 
        /* Constants are never weak.  */
@@ -15167,7 +15775,7 @@ fold_negate_const (tree arg0, tree type)
       }
 
     case REAL_CST:
-      t = build_real (type, real_value_negate (&TREE_REAL_CST (arg0)));
+      t = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0)));
       break;
 
     case FIXED_CST:
@@ -15226,7 +15834,7 @@ fold_abs_const (tree arg0, tree type)
 
     case REAL_CST:
       if (REAL_VALUE_NEGATIVE (TREE_REAL_CST (arg0)))
-       t = build_real (type, real_value_negate (&TREE_REAL_CST (arg0)));
+       t = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0)));
       else
        t =  arg0;
       break;
index e196579..e30981e 100644 (file)
@@ -27,10 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "input.h"
 #include "statistics.h"
 #include "vec.h"
-#include "vecir.h"
 #include "double-int.h"
-#include "real.h"
-#include "fixed-value.h"
 #include "alias.h"
 #include "options.h"
 
@@ -181,6 +178,11 @@ extern const unsigned char tree_code_length[];
 
 extern const char *const tree_code_name[];
 
+/* A vectors of trees.  */
+DEF_VEC_P(tree);
+DEF_VEC_ALLOC_P(tree,gc);
+DEF_VEC_ALLOC_P(tree,heap);
+
 /* We have to be able to tell cgraph about the needed-ness of the target
    of an alias.  This requires that the decl have been defined.  Aliases
    that precede their definition have to be queued for later processing.  */
@@ -409,7 +411,7 @@ struct GTY(()) tree_common {
    addressable_flag:
 
        TREE_ADDRESSABLE in
-           VAR_DECL, PARM_DECL, RESULT_DECL, FUNCTION_DECL, LABEL_DECL
+           VAR_DECL, FUNCTION_DECL, FIELD_DECL, LABEL_DECL
            all types
            CONSTRUCTOR, IDENTIFIER_NODE
            STMT_EXPR, it means we want the result of the enclosed expression
@@ -455,9 +457,6 @@ struct GTY(()) tree_common {
 
        CALL_CANNOT_INLINE_P in
            CALL_EXPR
-       ENUM_IS_SCOPED in
-          ENUMERAL_TYPE
 
    public_flag:
 
@@ -502,9 +501,6 @@ struct GTY(()) tree_common {
        OMP_CLAUSE_PRIVATE_OUTER_REF in
           OMP_CLAUSE_PRIVATE
 
-       TYPE_REF_IS_RVALUE in
-          REFERENCE_TYPE
-
    protected_flag:
 
        TREE_PROTECTED in
@@ -1104,10 +1100,13 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 \f
 /* Define many boolean fields that all tree nodes have.  */
 
-/* In VAR_DECL, PARM_DECL and RESULT_DECL nodes, nonzero means address
-   of this is needed.  So it cannot be in a register.
+/* In VAR_DECL nodes, nonzero means address of this is needed.
+   So it cannot be in a register.
    In a FUNCTION_DECL, nonzero means its address is needed.
    So it must be compiled even if it is an inline function.
+   In a FIELD_DECL node, it means that the programmer is permitted to
+   construct the address of this field.  This is used for aliasing
+   purposes: see record_component_aliases.
    In CONSTRUCTOR nodes, it means object constructed must be in memory.
    In LABEL_DECL nodes, it means a goto for this label has been seen
    from a place outside all binding contours that restore stack levels.
@@ -1163,9 +1162,6 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 /* Used to mark a CALL_EXPR as not suitable for inlining.  */
 #define CALL_CANNOT_INLINE_P(NODE) (CALL_EXPR_CHECK (NODE)->base.static_flag)
 
-/* Used to mark scoped enums.  */
-#define ENUM_IS_SCOPED(NODE) (ENUMERAL_TYPE_CHECK (NODE)->base.static_flag)
-
 /* In an expr node (usually a conversion) this means the node was made
    implicitly and should not lead to any sort of warning.  In a decl node,
    warnings concerning the decl should be suppressed.  This is used at
@@ -1345,10 +1341,6 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 /* Used in classes in C++. */
 #define TREE_PROTECTED(NODE) ((NODE)->base.protected_flag)
 
-/* True if reference type NODE is a C++ rvalue reference.  */
-#define TYPE_REF_IS_RVALUE(NODE) \
-  (REFERENCE_TYPE_CHECK (NODE)->base.private_flag)
-
 /* Nonzero in a _DECL if the use of the name is defined as a
    deprecated feature by __attribute__((deprecated)).  */
 #define TREE_DEPRECATED(NODE) \
@@ -1414,8 +1406,7 @@ struct GTY(()) tree_real_cst {
 /* In a FIXED_CST node.  */
 struct fixed_value;
 
-#define TREE_FIXED_CST_PTR(NODE) \
-  (FIXED_CST_CHECK (NODE)->fixed_cst.fixed_cst_ptr)
+#define TREE_FIXED_CST_PTR(NODE) (FIXED_CST_CHECK (NODE)->fixed_cst.fixed_cst_ptr)
 #define TREE_FIXED_CST(NODE) (*TREE_FIXED_CST_PTR (NODE))
 
 struct GTY(()) tree_fixed_cst {
@@ -1502,8 +1493,7 @@ struct GTY(()) tree_vec {
 #define CONSTRUCTOR_ELTS(NODE) (CONSTRUCTOR_CHECK (NODE)->constructor.elts)
 #define CONSTRUCTOR_ELT(NODE,IDX) \
   (VEC_index (constructor_elt, CONSTRUCTOR_ELTS (NODE), IDX))
-#define CONSTRUCTOR_NELTS(NODE) \
-  (VEC_length (constructor_elt, CONSTRUCTOR_ELTS (NODE)))
+#define CONSTRUCTOR_NELTS(NODE) (VEC_length (constructor_elt, CONSTRUCTOR_ELTS (NODE)))
 
 /* Iterate through the vector V of CONSTRUCTOR_ELT elements, yielding the
    value of each element (stored within VAL). IX must be a scratch variable
@@ -1584,8 +1574,7 @@ struct GTY(()) tree_constructor {
 /* The source location of this expression.  Non-tree_exp nodes such as
    decls and constants can be shared among multiple locations, so
    return nothing.  */
-#define EXPR_LOCATION(NODE) \
-  (EXPR_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
+#define EXPR_LOCATION(NODE) (EXPR_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
 #define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS)
 #define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION)
 #define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK ((NODE))->exp.locus)
@@ -1697,6 +1686,7 @@ extern void protected_set_expr_location (tree, location_t);
  */
 #define CALL_EXPR_FN(NODE) TREE_OPERAND (CALL_EXPR_CHECK (NODE), 1)
 #define CALL_EXPR_STATIC_CHAIN(NODE) TREE_OPERAND (CALL_EXPR_CHECK (NODE), 2)
+#define CALL_EXPR_ARGS(NODE) call_expr_arglist (NODE)
 #define CALL_EXPR_ARG(NODE, I) TREE_OPERAND (CALL_EXPR_CHECK (NODE), (I) + 3)
 #define call_expr_nargs(NODE) (VL_EXP_OPERAND_LENGTH(NODE) - 3)
 
@@ -1879,7 +1869,7 @@ struct GTY(()) tree_exp {
    the very first reference to S in the function is a read operation.
    Default definitions are always created by an empty statement and
    belong to no basic block.  */
-#define SSA_NAME_IS_DEFAULT_DEF(NODE) \
+#define SSA_NAME_IS_DEFAULT_DEF(NODE)  \
     SSA_NAME_CHECK (NODE)->base.default_def_flag
 
 /* Attributes for SSA_NAMEs for pointer-type variables.  */
@@ -1968,14 +1958,13 @@ struct GTY(()) tree_omp_clause {
 };
 \f
 
+struct varray_head_tag;
+
 /* In a BLOCK node.  */
 #define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars)
-#define BLOCK_NONLOCALIZED_VARS(NODE) \
-  (BLOCK_CHECK (NODE)->block.nonlocalized_vars)
-#define BLOCK_NUM_NONLOCALIZED_VARS(NODE) \
-  VEC_length (tree, BLOCK_NONLOCALIZED_VARS (NODE))
-#define BLOCK_NONLOCALIZED_VAR(NODE,N) \
-  VEC_index (tree, BLOCK_NONLOCALIZED_VARS (NODE), N)
+#define BLOCK_NONLOCALIZED_VARS(NODE) (BLOCK_CHECK (NODE)->block.nonlocalized_vars)
+#define BLOCK_NUM_NONLOCALIZED_VARS(NODE) VEC_length (tree, BLOCK_NONLOCALIZED_VARS (NODE))
+#define BLOCK_NONLOCALIZED_VAR(NODE,N) VEC_index (tree, BLOCK_NONLOCALIZED_VARS (NODE), N)
 #define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks)
 #define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
 /* Note: when changing this, make sure to find the places
@@ -2116,8 +2105,7 @@ extern enum machine_mode vector_type_mode (const_tree);
 /* For a VECTOR_TYPE node, this describes a different type which is emitted
    in the debugging output.  We use this to describe a vector as a
    structure containing an array.  */
-#define TYPE_DEBUG_REPRESENTATION_TYPE(NODE) \
-  (VECTOR_TYPE_CHECK (NODE)->type.values)
+#define TYPE_DEBUG_REPRESENTATION_TYPE(NODE) (VECTOR_TYPE_CHECK (NODE)->type.values)
 
 /* For record and union types, information about this type, as a base type
    for itself.  */
@@ -2501,25 +2489,11 @@ struct function;
    uses.  */
 #define DEBUG_TEMP_UID(NODE) (-DECL_UID (TREE_CHECK ((NODE), DEBUG_EXPR_DECL)))
 
-/* Every ..._DECL node gets a unique number that stays the same even
-   when the decl is copied by the inliner once it is set.  */
-#define DECL_PT_UID(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid == -1u \
-   ? (NODE)->decl_minimal.uid : (NODE)->decl_common.pt_uid)
-/* Initialize the ..._DECL node pt-uid to the decls uid.  */
-#define SET_DECL_PT_UID(NODE, UID) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid = (UID))
-/* Whether the ..._DECL node pt-uid has been initialized and thus needs to
-   be preserved when copyin the decl.  */
-#define DECL_PT_UID_SET_P(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid != -1u)
-
 /* These two fields describe where in the source code the declaration
    was.  If the declaration appears in several places (as for a C
    function that is declared first and then defined later), this
    information should refer to the definition.  */
-#define DECL_SOURCE_LOCATION(NODE) \
-  (DECL_MINIMAL_CHECK (NODE)->decl_minimal.locus)
+#define DECL_SOURCE_LOCATION(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.locus)
 #define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE))
 #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
 #define DECL_IS_BUILTIN(DECL) \
@@ -2533,8 +2507,7 @@ struct function;
     NULL_TREE or a TRANSLATION_UNIT_DECL if the given decl has "file
     scope".  */
 #define DECL_CONTEXT(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.context)
-#define DECL_FIELD_CONTEXT(NODE) \
-  (FIELD_DECL_CHECK (NODE)->decl_minimal.context)
+#define DECL_FIELD_CONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->decl_minimal.context)
 struct GTY(()) tree_decl_minimal {
   struct tree_common common;
   location_t locus;
@@ -2550,8 +2523,7 @@ struct GTY(()) tree_decl_minimal {
 
    The C front-end also uses this in a nested declaration of an inline
    function, to point back to the definition.  */
-#define DECL_ABSTRACT_ORIGIN(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.abstract_origin)
+#define DECL_ABSTRACT_ORIGIN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.abstract_origin)
 
 /* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract
    origin.  This is useful when setting the DECL_ABSTRACT_ORIGIN.  */
@@ -2562,13 +2534,11 @@ struct GTY(()) tree_decl_minimal {
    inline instance of some original (abstract) decl from an inline function;
    suppress any warnings about shadowing some other variable.  FUNCTION_DECL
    nodes can also have their abstract origin set to themselves.  */
-#define DECL_FROM_INLINE(NODE) \
-  (DECL_ABSTRACT_ORIGIN (NODE) != NULL_TREE \
-   && DECL_ABSTRACT_ORIGIN (NODE) != (NODE))
+#define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != NULL_TREE \
+                               && DECL_ABSTRACT_ORIGIN (NODE) != (NODE))
 
 /* In a DECL this is the field where attributes are stored.  */
-#define DECL_ATTRIBUTES(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.attributes)
+#define DECL_ATTRIBUTES(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.attributes)
 
 /* For a FUNCTION_DECL, holds the tree of BINDINGs.
    For a TRANSLATION_UNIT_DECL, holds the namespace's BLOCK.
@@ -2593,8 +2563,7 @@ struct GTY(()) tree_decl_minimal {
 #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)
 /* Set if the alignment of this DECL has been set by the user, for
    example with an 'aligned' attribute.  */
-#define DECL_USER_ALIGN(NODE) \
-  (DECL_COMMON_CHECK (NODE)->common.base.user_align)
+#define DECL_USER_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->common.base.user_align)
 /* Holds the machine mode corresponding to the declaration of a variable or
    field.  Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a
    FIELD_DECL.  */
@@ -2615,8 +2584,7 @@ struct GTY(()) tree_decl_minimal {
 /* Nonzero for a given ..._DECL node means that the name of this node should
    be ignored for symbolic debug purposes.  Moreover, for a FUNCTION_DECL,
    the body of the function should also be ignored.  */
-#define DECL_IGNORED_P(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag)
+#define DECL_IGNORED_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag)
 
 /* Nonzero for a given ..._DECL node means that this node represents an
    "abstract instance" of the given declaration (e.g. in the original
@@ -2624,12 +2592,10 @@ struct GTY(()) tree_decl_minimal {
    information, we mustn't try to generate any address information for nodes
    marked as "abstract instances" because we don't actually generate
    any code or allocate any data space for such instances.  */
-#define DECL_ABSTRACT(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.abstract_flag)
+#define DECL_ABSTRACT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.abstract_flag)
 
 /* Language-specific decl information.  */
-#define DECL_LANG_SPECIFIC(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.lang_specific)
+#define DECL_LANG_SPECIFIC(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_specific)
 
 /* In a VAR_DECL or FUNCTION_DECL, nonzero means external reference:
    do not allocate storage, and refer to a definition elsewhere.  Note that
@@ -2647,38 +2613,26 @@ struct GTY(()) tree_decl_minimal {
 
    Also set in some languages for variables, etc., outside the normal
    lexical scope, such as class instance variables.  */
-#define DECL_NONLOCAL(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.nonlocal_flag)
+#define DECL_NONLOCAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.nonlocal_flag)
 
 /* Used in VAR_DECLs to indicate that the variable is a vtable.
    Used in FIELD_DECLs for vtable pointers.
    Used in FUNCTION_DECLs to indicate that the function is virtual.  */
-#define DECL_VIRTUAL_P(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.virtual_flag)
+#define DECL_VIRTUAL_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.virtual_flag)
 
 /* Used to indicate that this DECL represents a compiler-generated entity.  */
-#define DECL_ARTIFICIAL(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.artificial_flag)
+#define DECL_ARTIFICIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.artificial_flag)
 
 /* Additional flags for language-specific uses.  */
-#define DECL_LANG_FLAG_0(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_0)
-#define DECL_LANG_FLAG_1(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_1)
-#define DECL_LANG_FLAG_2(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_2)
-#define DECL_LANG_FLAG_3(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_3)
-#define DECL_LANG_FLAG_4(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_4)
-#define DECL_LANG_FLAG_5(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_5)
-#define DECL_LANG_FLAG_6(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_6)
-#define DECL_LANG_FLAG_7(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_7)
-#define DECL_LANG_FLAG_8(NODE) \
-  (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_8)
+#define DECL_LANG_FLAG_0(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_0)
+#define DECL_LANG_FLAG_1(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_1)
+#define DECL_LANG_FLAG_2(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_2)
+#define DECL_LANG_FLAG_3(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_3)
+#define DECL_LANG_FLAG_4(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_4)
+#define DECL_LANG_FLAG_5(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_5)
+#define DECL_LANG_FLAG_6(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_6)
+#define DECL_LANG_FLAG_7(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_7)
+#define DECL_LANG_FLAG_8(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_8)
 
 /* Nonzero for a decl which is at file scope.  */
 #define DECL_FILE_SCOPE_P(EXP)                                         \
@@ -2756,9 +2710,6 @@ struct GTY(()) tree_decl_common {
   /* DECL_ALIGN.  It should have the same size as TYPE_ALIGN.  */
   unsigned int align;
 
-  /* UID for points-to sets, stable over copying from inlining.  */
-  unsigned int pt_uid;
-
   tree size_unit;
   tree initial;
   tree attributes;
@@ -2779,7 +2730,7 @@ extern void decl_value_expr_insert (tree, tree);
   (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL)->decl_common.decl_flag_2)
 #define DECL_VALUE_EXPR(NODE) \
   (decl_value_expr_lookup (DECL_WRTL_CHECK (NODE)))
-#define SET_DECL_VALUE_EXPR(NODE, VAL) \
+#define SET_DECL_VALUE_EXPR(NODE, VAL)                 \
   (decl_value_expr_insert (DECL_WRTL_CHECK (NODE), VAL))
 
 /* Holds the RTL expression for the value of a variable or function.
@@ -2797,14 +2748,12 @@ extern void decl_value_expr_insert (tree, tree);
 #define HAS_RTL_P(NODE) (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WRTL))
 
 /* Returns nonzero if the DECL_RTL for NODE has already been set.  */
-#define DECL_RTL_SET_P(NODE) \
-  (HAS_RTL_P (NODE) && DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl != NULL)
+#define DECL_RTL_SET_P(NODE)  (HAS_RTL_P (NODE) && DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl != NULL)
 
 /* Copy the RTL from NODE1 to NODE2.  If the RTL was not set for
    NODE1, it will not be set for NODE2; this is a lazy copy.  */
 #define COPY_DECL_RTL(NODE1, NODE2) \
-  (DECL_WRTL_CHECK (NODE2)->decl_with_rtl.rtl \
-   = DECL_WRTL_CHECK (NODE1)->decl_with_rtl.rtl)
+  (DECL_WRTL_CHECK (NODE2)->decl_with_rtl.rtl = DECL_WRTL_CHECK (NODE1)->decl_with_rtl.rtl)
 
 /* The DECL_RTL for NODE, if it is set, or NULL, if it is not set.  */
 #define DECL_RTL_IF_SET(NODE) (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL)
@@ -2826,14 +2775,12 @@ struct GTY(()) tree_decl_with_rtl {
    field from DECL_FIELD_OFFSET.  This field may be nonzero even for fields
    that are not bit fields (since DECL_OFFSET_ALIGN may be larger than the
    natural alignment of the field's type).  */
-#define DECL_FIELD_BIT_OFFSET(NODE) \
-  (FIELD_DECL_CHECK (NODE)->field_decl.bit_offset)
+#define DECL_FIELD_BIT_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.bit_offset)
 
 /* In a FIELD_DECL, this indicates whether the field was a bit-field and
    if so, the type that was originally specified for it.
    TREE_TYPE may have been modified (in finish_struct).  */
-#define DECL_BIT_FIELD_TYPE(NODE) \
-  (FIELD_DECL_CHECK (NODE)->field_decl.bit_field_type)
+#define DECL_BIT_FIELD_TYPE(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.bit_field_type)
 
 /* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
    if nonzero, indicates that the field occupies the type.  */
@@ -2930,8 +2877,7 @@ struct GTY(()) tree_const_decl {
 
 /* For PARM_DECL, holds an RTL for the stack slot or register
    where the data was actually passed.  */
-#define DECL_INCOMING_RTL(NODE) \
-  (PARM_DECL_CHECK (NODE)->parm_decl.incoming_rtl)
+#define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->parm_decl.incoming_rtl)
 
 struct GTY(()) tree_parm_decl {
   struct tree_decl_with_rtl common;
@@ -2940,43 +2886,25 @@ struct GTY(()) tree_parm_decl {
 };
 
 
-/* Nonzero for a given ..._DECL node means that no warnings should be
-   generated just because this node is unused.  */
-#define DECL_IN_SYSTEM_HEADER(NODE) \
-  (in_system_header_at (DECL_SOURCE_LOCATION (NODE)))
+/* Nonzero in a decl means that the gimplifier has seen (or placed)
+   this variable in a BIND_EXPR.  */
+#define DECL_SEEN_IN_BIND_EXPR_P(NODE) \
+  (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.seen_in_bind_expr)
 
 /* Used to indicate that the linkage status of this DECL is not yet known,
    so it should not be output now.  */
-#define DECL_DEFER_OUTPUT(NODE) \
-  (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.defer_output)
-
-/* In a VAR_DECL that's static,
-   nonzero if the space is in the text section.  */
-#define DECL_IN_TEXT_SECTION(NODE) \
-  (VAR_DECL_CHECK (NODE)->decl_with_vis.in_text_section)
-
-/* In a VAR_DECL that's static,
-   nonzero if it belongs to the global constant pool.  */
-#define DECL_IN_CONSTANT_POOL(NODE) \
-  (VAR_DECL_CHECK (NODE)->decl_with_vis.in_constant_pool)
+#define DECL_DEFER_OUTPUT(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.defer_output)
 
-/* Nonzero for a given ..._DECL node means that this node should be
-   put in .common, if possible.  If a DECL_INITIAL is given, and it
-   is not error_mark_node, then the decl cannot be put in .common.  */
-#define DECL_COMMON(NODE) \
-  (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.common_flag)
-
-/* In a VAR_DECL, nonzero if the decl is a register variable with
-   an explicit asm specification.  */
-#define DECL_HARD_REGISTER(NODE)  \
-  (VAR_DECL_CHECK (NODE)->decl_with_vis.hard_register)
+/* Nonzero for a given ..._DECL node means that no warnings should be
+   generated just because this node is unused.  */
+#define DECL_IN_SYSTEM_HEADER(NODE) \
+  (in_system_header_at (DECL_SOURCE_LOCATION (NODE)))
 
   /* Used to indicate that this DECL has weak linkage.  */
 #define DECL_WEAK(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.weak_flag)
 
 /* Used to indicate that the DECL is a dllimport.  */
-#define DECL_DLLIMPORT_P(NODE) \
-  (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.dllimport_flag)
+#define DECL_DLLIMPORT_P(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.dllimport_flag)
 
 /* Used in a DECL to indicate that, even if it TREE_PUBLIC, it need
    not be put out unless it is needed in this translation unit.
@@ -2987,15 +2915,9 @@ struct GTY(()) tree_parm_decl {
    back-end; it is up to front-ends which set this flag to ensure
    that there will never be any harm, other than bloat, in putting out
    something which is DECL_COMDAT.  */
-#define DECL_COMDAT(NODE) \
-  (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_flag)
+#define DECL_COMDAT(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_flag)
 
-#define DECL_COMDAT_GROUP(NODE) \
-  (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_group)
-
-/* Used in TREE_PUBLIC decls to indicate that copies of this DECL in
-   multiple translation units should be merged.  */
-#define DECL_ONE_ONLY(NODE) (DECL_COMDAT_GROUP (NODE) != NULL_TREE)
+#define DECL_COMDAT_GROUP(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_group)
 
 /* A replaceable function is one which may be replaced at link-time
    with an entirely different definition, provided that the
@@ -3031,8 +2953,7 @@ struct GTY(()) tree_parm_decl {
    the NODE might still have a DECL_ASSEMBLER_NAME -- it just hasn't been set
    yet.  */
 #define DECL_ASSEMBLER_NAME_SET_P(NODE) \
-  (HAS_DECL_ASSEMBLER_NAME_P (NODE) \
-   && DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name != NULL_TREE)
+  (HAS_DECL_ASSEMBLER_NAME_P (NODE) &&  DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name != NULL_TREE)
 
 /* Set the DECL_ASSEMBLER_NAME for NODE to NAME.  */
 #define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \
@@ -3055,37 +2976,18 @@ struct GTY(()) tree_parm_decl {
 
 /* Records the section name in a section attribute.  Used to pass
    the name from decl_attributes to make_function_rtl and make_decl_rtl.  */
-#define DECL_SECTION_NAME(NODE) \
-  (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.section_name)
-
-/* Nonzero in a decl means that the gimplifier has seen (or placed)
-   this variable in a BIND_EXPR.  */
-#define DECL_SEEN_IN_BIND_EXPR_P(NODE) \
-  (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.seen_in_bind_expr)
+#define DECL_SECTION_NAME(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.section_name)
 
 /* Value of the decls's visibility attribute */
-#define DECL_VISIBILITY(NODE) \
-  (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility)
+#define DECL_VISIBILITY(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility)
 
 /* Nonzero means that the decl had its visibility specified rather than
    being inferred.  */
-#define DECL_VISIBILITY_SPECIFIED(NODE) \
-  (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility_specified)
+#define DECL_VISIBILITY_SPECIFIED(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility_specified)
 
-/* In a VAR_DECL, the model to use if the data should be allocated from
-   thread-local storage.  */
-#define DECL_TLS_MODEL(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model)
-
-/* In a VAR_DECL, nonzero if the data should be allocated from
-   thread-local storage.  */
-#define DECL_THREAD_LOCAL_P(NODE) \
-  (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model >= TLS_MODEL_REAL)
-
-/* In a non-local VAR_DECL with static storage duration, true if the
-   variable has an initialization priority.  If false, the variable
-   will be initialized at the DEFAULT_INIT_PRIORITY.  */
-#define DECL_HAS_INIT_PRIORITY_P(NODE) \
-  (VAR_DECL_CHECK (NODE)->decl_with_vis.init_priority_p)
+/* Used in TREE_PUBLIC decls to indicate that copies of this DECL in
+   multiple translation units should be merged.  */
+#define DECL_ONE_ONLY(NODE) (DECL_COMDAT_GROUP (NODE) != NULL_TREE)
 
 struct GTY(()) tree_decl_with_vis {
  struct tree_decl_with_rtl common;
@@ -3099,8 +3001,9 @@ struct GTY(()) tree_decl_with_vis {
  unsigned thread_local : 1;
  unsigned common_flag : 1;
  unsigned in_text_section : 1;
- unsigned in_constant_pool : 1;
  unsigned dllimport_flag : 1;
+ /* Used by C++.  Might become a generic decl flag.  */
+ unsigned shadowed_for_var_p : 1;
  /* Don't belong to VAR_DECL exclusively.  */
  unsigned weak_flag : 1;
 
@@ -3113,11 +3016,22 @@ struct GTY(()) tree_decl_with_vis {
 
  /* Belong to FUNCTION_DECL exclusively.  */
  unsigned init_priority_p : 1;
- /* Used by C++ only.  Might become a generic decl flag.  */
- unsigned shadowed_for_var_p : 1;
- /* 14 unused bits. */
+ /* 15 unused bits. */
 };
 
+/* In a VAR_DECL that's static,
+   nonzero if the space is in the text section.  */
+#define DECL_IN_TEXT_SECTION(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.in_text_section)
+
+/* Nonzero for a given ..._DECL node means that this node should be
+   put in .common, if possible.  If a DECL_INITIAL is given, and it
+   is not error_mark_node, then the decl cannot be put in .common.  */
+#define DECL_COMMON(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.common_flag)
+
+/* In a VAR_DECL, nonzero if the decl is a register variable with
+   an explicit asm specification.  */
+#define DECL_HARD_REGISTER(NODE)  (VAR_DECL_CHECK (NODE)->decl_with_vis.hard_register)
+
 extern tree decl_debug_expr_lookup (tree);
 extern void decl_debug_expr_insert (tree, tree);
 /* For VAR_DECL, this is set to either an expression that it was split
@@ -3137,6 +3051,12 @@ extern priority_type decl_fini_priority_lookup (tree);
 extern void decl_init_priority_insert (tree, priority_type);
 extern void decl_fini_priority_insert (tree, priority_type);
 
+/* In a non-local VAR_DECL with static storage duration, true if the
+   variable has an initialization priority.  If false, the variable
+   will be initialized at the DEFAULT_INIT_PRIORITY.  */
+#define DECL_HAS_INIT_PRIORITY_P(NODE) \
+  (VAR_DECL_CHECK (NODE)->decl_with_vis.init_priority_p)
+
 /* For a VAR_DECL or FUNCTION_DECL the initialization priority of
    NODE.  */
 #define DECL_INIT_PRIORITY(NODE) \
@@ -3163,6 +3083,15 @@ extern void decl_fini_priority_insert (tree, priority_type);
    libraries.  */
 #define MAX_RESERVED_INIT_PRIORITY 100
 
+/* In a VAR_DECL, the model to use if the data should be allocated from
+   thread-local storage.  */
+#define DECL_TLS_MODEL(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model)
+
+/* In a VAR_DECL, nonzero if the data should be allocated from
+   thread-local storage.  */
+#define DECL_THREAD_LOCAL_P(NODE) \
+  (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model >= TLS_MODEL_REAL)
+
 #define DECL_VAR_ANN_PTR(NODE) \
   (TREE_CODE (NODE) == VAR_DECL ? &(NODE)->var_decl.ann \
    : TREE_CODE (NODE) == PARM_DECL ? &(NODE)->parm_decl.ann \
@@ -3177,8 +3106,7 @@ struct GTY(()) tree_var_decl {
 
 /* This field is used to reference anything in decl.result and is meant only
    for use by the garbage collector.  */
-#define DECL_RESULT_FLD(NODE) \
-  (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.result)
+#define DECL_RESULT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.result)
 
 /* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways.
    Before the struct containing the FUNCTION_DECL is laid out,
@@ -3188,8 +3116,7 @@ struct GTY(()) tree_var_decl {
    to an INTEGER_CST node which is suitable for use as an index
    into the virtual function table.
    C++ also uses this field in namespaces, hence the DECL_NON_COMMON_CHECK.  */
-#define DECL_VINDEX(NODE) \
-  (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.vindex)
+#define DECL_VINDEX(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.vindex)
 
 struct GTY(())
  tree_decl_non_common {
@@ -3208,19 +3135,16 @@ struct GTY(())
 #define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.result)
 
 /* In a FUNCTION_DECL, nonzero if the function cannot be inlined.  */
-#define DECL_UNINLINABLE(NODE) \
-  (FUNCTION_DECL_CHECK (NODE)->function_decl.uninlinable)
+#define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.uninlinable)
 
 /* In a FUNCTION_DECL, the saved representation of the body of the
    entire function.  */
-#define DECL_SAVED_TREE(NODE) \
-  (FUNCTION_DECL_CHECK (NODE)->decl_non_common.saved_tree)
+#define DECL_SAVED_TREE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.saved_tree)
 
 /* Nonzero in a FUNCTION_DECL means this function should be treated
    as if it were a malloc, meaning it returns a pointer that is
    not an alias.  */
-#define DECL_IS_MALLOC(NODE) \
-  (FUNCTION_DECL_CHECK (NODE)->function_decl.malloc_flag)
+#define DECL_IS_MALLOC(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.malloc_flag)
 
 /* Nonzero in a FUNCTION_DECL means this function should be treated as
    C++ operator new, meaning that it returns a pointer for which we
@@ -3249,8 +3173,7 @@ struct GTY(())
 /* Nonzero in a FUNCTION_DECL means this function should be treated
    as "novops" function (function that does not read global memory,
    but may have arbitrary side effects).  */
-#define DECL_IS_NOVOPS(NODE) \
-  (FUNCTION_DECL_CHECK (NODE)->function_decl.novops_flag)
+#define DECL_IS_NOVOPS(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.novops_flag)
 
 /* Used in FUNCTION_DECLs to indicate that they should be run automatically
    at the beginning or end of execution.  */
@@ -3300,8 +3223,7 @@ struct GTY(())
 
 /* For FUNCTION_DECL, this holds a pointer to a structure ("struct function")
    that describes the status of this function.  */
-#define DECL_STRUCT_FUNCTION(NODE) \
-  (FUNCTION_DECL_CHECK (NODE)->function_decl.f)
+#define DECL_STRUCT_FUNCTION(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.f)
 
 /* In a FUNCTION_DECL, nonzero means a built in function.  */
 #define DECL_BUILT_IN(NODE) (DECL_BUILT_IN_CLASS (NODE) != NOT_BUILT_IN)
@@ -3313,10 +3235,8 @@ struct GTY(())
 /* In FUNCTION_DECL, a chain of ..._DECL nodes.
    VAR_DECL and PARM_DECL reserve the arguments slot for language-specific
    uses.  */
-#define DECL_ARGUMENTS(NODE) \
-  (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments)
-#define DECL_ARGUMENT_FLD(NODE) \
-  (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments)
+#define DECL_ARGUMENTS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments)
+#define DECL_ARGUMENT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments)
 
 /* In FUNCTION_DECL, the function specific target options to use when compiling
    this function.  */
@@ -3376,8 +3296,7 @@ struct GTY(()) tree_function_decl {
 };
 
 /* For a TYPE_DECL, holds the "original" type.  (TREE_TYPE has the copy.) */
-#define DECL_ORIGINAL_TYPE(NODE) \
-  (TYPE_DECL_CHECK (NODE)->decl_non_common.result)
+#define DECL_ORIGINAL_TYPE(NODE) (TYPE_DECL_CHECK (NODE)->decl_non_common.result)
 
 /* In a TYPE_DECL nonzero means the detail info about this type is not dumped
    into stabs.  Instead it will generate cross reference ('x') of names.
@@ -3811,8 +3730,7 @@ extern GTY(()) tree global_trees[TI_MAX];
 #define void_list_node                  global_trees[TI_VOID_LIST_NODE]
 
 #define main_identifier_node           global_trees[TI_MAIN_IDENTIFIER]
-#define MAIN_NAME_P(NODE) \
-  (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)
+#define MAIN_NAME_P(NODE) (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)
 
 /* Optimization options (OPTIMIZATION_NODE) to use for default and current
    functions.  */
@@ -3992,28 +3910,12 @@ extern tree build_var_debug_value_stat (tree, tree MEM_STAT_DECL);
 #define build_var_debug_value(t1,t2) \
   build_var_debug_value_stat (t1,t2 MEM_STAT_INFO)
 
-/* Constructs double_int from tree CST.  */
-
-static inline double_int
-tree_to_double_int (const_tree cst)
-{
-  return TREE_INT_CST (cst);
-}
-
-extern tree double_int_to_tree (tree, double_int);
-extern bool double_int_fits_to_tree_p (const_tree, double_int);
-
-/* Create an INT_CST node with a CST value zero extended.  */
-
-static inline tree
-build_int_cstu (tree type, unsigned HOST_WIDE_INT cst)
-{
-  return double_int_to_tree (type, uhwi_to_double_int (cst));
-}
-
 extern tree build_int_cst (tree, HOST_WIDE_INT);
 extern tree build_int_cst_type (tree, HOST_WIDE_INT);
+extern tree build_int_cstu (tree, unsigned HOST_WIDE_INT);
 extern tree build_int_cst_wide (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT);
+extern tree build_int_cst_wide_type (tree,
+                                    unsigned HOST_WIDE_INT, HOST_WIDE_INT);
 extern tree build_vector (tree, tree);
 extern tree build_vector_from_ctor (tree, VEC(constructor_elt,gc) *);
 extern tree build_constructor (tree, VEC(constructor_elt,gc) *);
@@ -4053,7 +3955,7 @@ extern tree make_unsigned_type (int);
 extern tree signed_or_unsigned_type_for (int, tree);
 extern tree signed_type_for (tree);
 extern tree unsigned_type_for (tree);
-extern void initialize_sizetypes (void);
+extern void initialize_sizetypes (bool);
 extern void set_sizetype (tree);
 extern void fixup_unsigned_type (tree);
 extern tree build_pointer_type_for_mode (tree, enum machine_mode, bool);
@@ -4423,9 +4325,9 @@ extern tree size_diffop_loc (location_t, tree, tree);
 extern tree round_up_loc (location_t, tree, int);
 #define round_down(T,N) round_down_loc (UNKNOWN_LOCATION, T, N)
 extern tree round_down_loc (location_t, tree, int);
-extern VEC(tree,gc) *get_pending_sizes (void);
+extern tree get_pending_sizes (void);
 extern void put_pending_size (tree);
-extern void put_pending_sizes (VEC(tree,gc) *);
+extern void put_pending_sizes (tree);
 extern void finalize_size_functions (void);
 
 /* Type for sizes of data-type.  */
@@ -4477,6 +4379,10 @@ extern tree first_field (const_tree);
 
 extern bool initializer_zerop (const_tree);
 
+/* Given a CONSTRUCTOR CTOR, return the elements as a TREE_LIST.  */
+
+extern tree ctor_to_list (tree);
+
 /* Given a CONSTRUCTOR CTOR, return the element values as a vector.  */
 
 extern VEC(tree,gc) *ctor_to_vec (tree);
@@ -4812,6 +4718,7 @@ extern tree lower_bound_in_type (tree, tree);
 extern int operand_equal_for_phi_arg_p (const_tree, const_tree);
 extern tree call_expr_arg (tree, int);
 extern tree *call_expr_argp (tree, int);
+extern tree call_expr_arglist (tree);
 extern tree create_artificial_label (location_t);
 extern const char *get_name (tree);
 extern bool stdarg_p (tree);
@@ -4913,6 +4820,44 @@ extern void fold_undefer_overflow_warnings (bool, const_gimple, int);
 extern void fold_undefer_and_ignore_overflow_warnings (void);
 extern bool fold_deferring_overflow_warnings_p (void);
 
+extern tree force_fit_type_double (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                                  int, bool);
+
+extern int fit_double_type (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                           unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, const_tree);
+extern int add_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                                unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                                unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
+                                bool);
+#define add_double(l1,h1,l2,h2,lv,hv) \
+  add_double_with_sign (l1, h1, l2, h2, lv, hv, false)
+extern int neg_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                      unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
+extern int mul_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                                unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                                unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
+                                bool);
+#define mul_double(l1,h1,l2,h2,lv,hv) \
+  mul_double_with_sign (l1, h1, l2, h2, lv, hv, false)
+extern void lshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                          HOST_WIDE_INT, unsigned int,
+                          unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, bool);
+extern void rshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                          HOST_WIDE_INT, unsigned int,
+                          unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, bool);
+extern void lrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                           HOST_WIDE_INT, unsigned int,
+                           unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
+extern void rrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
+                           HOST_WIDE_INT, unsigned int,
+                           unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
+
+extern int div_and_round_double (enum tree_code, int, unsigned HOST_WIDE_INT,
+                                HOST_WIDE_INT, unsigned HOST_WIDE_INT,
+                                HOST_WIDE_INT, unsigned HOST_WIDE_INT *,
+                                HOST_WIDE_INT *, unsigned HOST_WIDE_INT *,
+                                HOST_WIDE_INT *);
+
 enum operand_equal_flag
 {
   OEP_ONLY_CONST = 1,
@@ -5062,7 +5007,7 @@ extern int real_onep (const_tree);
 extern int real_twop (const_tree);
 extern int real_minus_onep (const_tree);
 extern void init_ttree (void);
-extern void build_common_tree_nodes (bool);
+extern void build_common_tree_nodes (bool, bool);
 extern void build_common_tree_nodes_2 (int);
 extern void build_common_builtin_nodes (void);
 extern tree build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
@@ -5080,8 +5025,6 @@ extern location_t tree_nonartificial_location (tree);
 
 extern tree block_ultimate_origin (const_tree);
 
-extern tree get_binfo_at_offset (tree, HOST_WIDE_INT, tree);
-
 /* In tree-nested.c */
 extern tree build_addr (tree, tree);
 
@@ -5164,30 +5107,6 @@ extern tree build_duplicate_type (tree);
 extern int flags_from_decl_or_type (const_tree);
 extern int call_expr_flags (const_tree);
 
-/* Call argument flags.  */
-
-/* Nonzero if the argument is not dereferenced recursively, thus only
-   directly reachable memory is read or written.  */
-#define EAF_DIRECT             (1 << 0)
-/* Nonzero if memory reached by the argument is not clobbered.  */
-#define EAF_NOCLOBBER          (1 << 1)
-/* Nonzero if the argument does not escape.  */
-#define EAF_NOESCAPE           (1 << 2)
-/* Nonzero if the argument is not used by the function.  */
-#define EAF_UNUSED             (1 << 3)
-
-/* Call return flags.  */
-
-/* Mask for the argument number that is returned.  Lower two bits of
-   the return flags, encodes argument slots zero to three.  */
-#define ERF_RETURN_ARG_MASK    (3)
-/* Nonzero if the return value is equal to the argument number
-   flags & ERF_RETURN_ARG_MASK.  */
-#define ERF_RETURNS_ARG                (1 << 2)
-/* Nonzero if the return value does not alias with anything.  Functions
-   with the malloc attribute have this set on their return value.  */
-#define ERF_NOALIAS            (1 << 3)
-
 extern int setjmp_call_p (const_tree);
 extern bool gimple_alloca_call_p (const_gimple);
 extern bool alloca_call_p (const_tree);
@@ -5219,7 +5138,6 @@ extern void internal_reference_types (void);
 extern unsigned int update_alignment_for_field (record_layout_info, tree,
                                                 unsigned int);
 /* varasm.c */
-extern tree tree_output_constant_def (tree);
 extern void make_decl_rtl (tree);
 extern rtx make_decl_rtl_for_debug (tree);
 extern void make_decl_one_only (tree, tree);
@@ -5402,6 +5320,11 @@ struct GTY(()) tree_priority_map {
 
 tree target_for_debug_bind (tree);
 
+/* In tree-ssa-ccp.c */
+extern tree maybe_fold_offset_to_reference (location_t, tree, tree, tree);
+extern tree maybe_fold_offset_to_address (location_t, tree, tree, tree);
+extern tree maybe_fold_stmt_addition (location_t, tree, tree, tree);
+
 /* In tree-ssa-address.c.  */
 extern tree tree_mem_ref_addr (tree, tree);
 extern void copy_mem_ref_info (tree, tree);
@@ -5422,6 +5345,9 @@ extern tree build_personality_function (const char *);
 
 void init_inline_once (void);
 
+/* In ipa-reference.c.  Used for parsing attributes of asm code.  */
+extern GTY(()) tree memory_identifier_string;
+
 /* Compute the number of operands in an expression node NODE.  For
    tcc_vl_exp nodes like CALL_EXPRs, this is stored in the node itself,
    otherwise it is looked up from the node's code.  */