+ switch (*format_ptr++)
+ {
+ case 'e':
+ if (XEXP (orig, i) != NULL)
+ XEXP (copy, i) = copy_rtx (XEXP (orig, i));
+ break;
+
+ case 'E':
+ case 'V':
+ if (XVEC (orig, i) != NULL)
+ {
+ XVEC (copy, i) = rtvec_alloc (XVECLEN (orig, i));
+ for (j = 0; j < XVECLEN (copy, i); j++)
+ XVECEXP (copy, i, j) = copy_rtx (XVECEXP (orig, i, j));
+ }
+ break;
+
+ case 't':
+ case 'w':
+ case 'i':
+ case 's':
+ case 'S':
+ case 'T':
+ case 'u':
+ case 'B':
+ case '0':
+ /* These are left unchanged. */
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+ return copy;
+}
+
+/* Create a new copy of an rtx. Only copy just one level. */
+
+rtx
+shallow_copy_rtx_stat (const_rtx orig MEM_STAT_DECL)
+{
+ const unsigned int size = rtx_size (orig);
+ rtx const copy = (rtx) ggc_alloc_zone_pass_stat (size, &rtl_zone);
+ return (rtx) memcpy (copy, orig, size);
+}
+\f
+/* Nonzero when we are generating CONCATs. */
+int generating_concat_p;
+
+/* Nonzero when we are expanding trees to RTL. */
+int currently_expanding_to_rtl;
+
+\f
+
+/* Same as rtx_equal_p, but call CB on each pair of rtx if CB is not NULL.
+ When the callback returns true, we continue with the new pair.
+ Whenever changing this function check if rtx_equal_p below doesn't need
+ changing as well. */
+
+int
+rtx_equal_p_cb (const_rtx x, const_rtx y, rtx_equal_p_callback_function cb)
+{
+ int i;
+ int j;
+ enum rtx_code code;
+ const char *fmt;
+ rtx nx, ny;
+
+ if (x == y)
+ return 1;
+ if (x == 0 || y == 0)
+ return 0;
+
+ /* Invoke the callback first. */
+ if (cb != NULL
+ && ((*cb) (&x, &y, &nx, &ny)))
+ return rtx_equal_p_cb (nx, ny, cb);
+
+ code = GET_CODE (x);
+ /* Rtx's of different codes cannot be equal. */
+ if (code != GET_CODE (y))
+ return 0;
+
+ /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent.
+ (REG:SI x) and (REG:HI x) are NOT equivalent. */
+
+ if (GET_MODE (x) != GET_MODE (y))
+ return 0;
+
+ /* MEMs refering to different address space are not equivalent. */
+ if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
+ return 0;
+
+ /* Some RTL can be compared nonrecursively. */
+ switch (code)