]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove poly_int_pod
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 29 Sep 2023 16:55:12 +0000 (17:55 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 29 Sep 2023 16:55:12 +0000 (17:55 +0100)
poly_int was written before the switch to C++11 and so couldn't
use explicit default constructors.  This led to an awkward split
between poly_int_pod and poly_int.  poly_int simply inherited from
poly_int_pod and added constructors, with the argumentless constructor
having an empty body.  But inheritance meant that poly_int had to
repeat the assignment operators from poly_int_pod (again, no C++11,
so no "using" to inherit base-class implementations).

All that goes away if we switch to using default constructors.

The main complication is ensuring that braced initialisation still
gives a constexpr, so that static variables can be initialised without
runtime code.  The two problems here are:

(1) When initialising a poly_int<N, wide_int> with fewer than N
    coefficients, the other coefficients need to be a zero of
    the same precision as the explicit coefficients.  This was
    previously done in a for loop using wi::ints_for<...>::zero,
    but C++11 constexpr constructors can't have function bodies.
    The patch instead uses a series of delegated initialisers to
    fill in the implicit coefficients.

(2) The initialisation in:

      void f(int x) {
        unsigned int foo {x};
      }

    produces the warning:

      warning: narrowing conversion of 'x' from 'int' to 'unsigned int' [-Wnarrowing]

    whereas:

      void f(int x) {
        unsigned int foo = x;
      }

    does not.  So switching to direct initialisation of the coeffs array
    would mean that:

      poly_uin64_t x = 0;

    would trigger a warning for using 0 rather than 0u.  That seemed
    overly pedantic, so the patch adds explicit casts to the constructor.
    The complication is to do that without adding extra code to
    wide-int versions.  The patch uses a new init_cast type for that.

gcc/
* poly-int.h (poly_int_pod): Delete.
(poly_coeff_traits::init_cast): New type.
(poly_int_full, poly_int_hungry, poly_int_fullness): New structures.
(poly_int): Replace constructors that take 1 and 2 coefficients with
a general one that takes an arbitrary number of coefficients.
Delegate initialization to two new private constructors, one of
which uses the coefficients as-is and one of which adds an extra
zero of the appropriate type (and precision, where applicable).
(gt_ggc_mx, gt_pch_nx): Operate on poly_ints rather than poly_int_pods.
* poly-int-types.h (poly_uint16_pod, poly_int64_pod, poly_uint64_pod)
(poly_offset_int_pod, poly_wide_int_pod, poly_widest_int_pod): Delete.
* gengtype.cc (main): Don't register poly_int64_pod.
* calls.cc (initialize_argument_information): Use poly_int rather
than poly_int_pod.
(combine_pending_stack_adjustment_and_call): Likewise.
* config/aarch64/aarch64.cc (pure_scalable_type_info): Likewise.
* data-streamer.h (bp_unpack_poly_value): Likewise.
* dwarf2cfi.cc (struct dw_trace_info): Likewise.
(struct queued_reg_save): Likewise.
* dwarf2out.h (struct dw_cfa_location): Likewise.
* emit-rtl.h (struct incoming_args): Likewise.
(struct rtl_data): Likewise.
* expr.cc (get_bit_range): Likewise.
(get_inner_reference): Likewise.
* expr.h (get_bit_range): Likewise.
* fold-const.cc (split_address_to_core_and_offset): Likewise.
(ptr_difference_const): Likewise.
* fold-const.h (ptr_difference_const): Likewise.
* function.cc (try_fit_stack_local): Likewise.
(instantiate_new_reg): Likewise.
* function.h (struct expr_status): Likewise.
(struct args_size): Likewise.
* genmodes.cc (ZERO_COEFFS): Likewise.
(mode_size_inline): Likewise.
(mode_nunits_inline): Likewise.
(emit_mode_precision): Likewise.
(emit_mode_size): Likewise.
(emit_mode_nunits): Likewise.
* gimple-fold.cc (get_base_constructor): Likewise.
* gimple-ssa-store-merging.cc (struct symbolic_number): Likewise.
* inchash.h (class hash): Likewise.
* ipa-modref-tree.cc (modref_access_node::dump): Likewise.
* ipa-modref.cc (modref_access_analysis::merge_call_side_effects):
Likewise.
* ira-int.h (ira_spilled_reg_stack_slot): Likewise.
* lra-eliminations.cc (self_elim_offsets): Likewise.
* machmode.h (mode_size, mode_precision, mode_nunits): Likewise.
* omp-low.cc (omplow_simd_context): Likewise.
* pretty-print.cc (pp_wide_integer): Likewise.
* pretty-print.h (pp_wide_integer): Likewise.
* reload.cc (struct decomposition): Likewise.
* reload.h (struct reload): Likewise.
* reload1.cc (spill_stack_slot_width): Likewise.
(struct elim_table): Likewise.
(offsets_at): Likewise.
(init_eliminable_invariants): Likewise.
* rtl.h (union rtunion): Likewise.
(poly_int_rtx_p): Likewise.
(strip_offset): Likewise.
(strip_offset_and_add): Likewise.
* rtlanal.cc (strip_offset): Likewise.
* tree-dfa.cc (get_ref_base_and_extent): Likewise.
(get_addr_base_and_unit_offset_1): Likewise.
(get_addr_base_and_unit_offset): Likewise.
* tree-dfa.h (get_ref_base_and_extent): Likewise.
(get_addr_base_and_unit_offset_1): Likewise.
(get_addr_base_and_unit_offset): Likewise.
* tree-ssa-loop-ivopts.cc (struct iv_use): Likewise.
(strip_offset): Likewise.
* tree-ssa-sccvn.h (struct vn_reference_op_struct): Likewise.
* tree.cc (ptrdiff_tree_p): Likewise.
* tree.h (poly_int_tree_p): Likewise.
(ptrdiff_tree_p): Likewise.
(get_inner_reference): Likewise.

gcc/testsuite/
* gcc.dg/plugin/poly-int-tests.h (test_num_coeffs_extra): Use
poly_int rather than poly_int_pod.

39 files changed:
gcc/calls.cc
gcc/config/aarch64/aarch64.cc
gcc/data-streamer.h
gcc/dwarf2cfi.cc
gcc/dwarf2out.h
gcc/emit-rtl.h
gcc/expr.cc
gcc/expr.h
gcc/fold-const.cc
gcc/fold-const.h
gcc/function.cc
gcc/function.h
gcc/gengtype.cc
gcc/genmodes.cc
gcc/gimple-fold.cc
gcc/gimple-ssa-store-merging.cc
gcc/inchash.h
gcc/ipa-modref-tree.cc
gcc/ipa-modref.cc
gcc/ira-int.h
gcc/lra-eliminations.cc
gcc/machmode.h
gcc/omp-low.cc
gcc/poly-int-types.h
gcc/poly-int.h
gcc/pretty-print.cc
gcc/pretty-print.h
gcc/reload.cc
gcc/reload.h
gcc/reload1.cc
gcc/rtl.h
gcc/rtlanal.cc
gcc/testsuite/gcc.dg/plugin/poly-int-tests.h
gcc/tree-dfa.cc
gcc/tree-dfa.h
gcc/tree-ssa-loop-ivopts.cc
gcc/tree-ssa-sccvn.h
gcc/tree.cc
gcc/tree.h

index 1f3a6d5c45099499deeef63f867ed11774dec47e..e9e69517997e98d4a46fbb21f3c249019567982a 100644 (file)
@@ -1291,7 +1291,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
                                 cumulative_args_t args_so_far,
                                 int reg_parm_stack_space,
                                 rtx *old_stack_level,
-                                poly_int64_pod *old_pending_adj,
+                                poly_int64 *old_pending_adj,
                                 bool *must_preallocate, int *ecf_flags,
                                 bool *may_tailcall, bool call_from_thunk_p)
 {
@@ -2298,7 +2298,7 @@ load_register_parameters (struct arg_data *args, int num_actuals,
    bytes that should be popped after the call.  */
 
 static bool
-combine_pending_stack_adjustment_and_call (poly_int64_pod *adjustment_out,
+combine_pending_stack_adjustment_and_call (poly_int64 *adjustment_out,
                                           poly_int64 unadjusted_args_size,
                                           struct args_size *args_size,
                                           unsigned int preferred_unit_stack_boundary)
index dcded70c981ec9a1019a4414e6acf10c6113fe61..9fbfc548a891f5d11940c6fd3c49a14bfbdec886 100644 (file)
@@ -257,7 +257,7 @@ public:
     machine_mode orig_mode;
 
     /* The offset in bytes of the piece from the start of the type.  */
-    poly_uint64_pod offset;
+    poly_uint64 offset;
   };
 
   /* Divides types analyzed as IS_PST into individual pieces.  The pieces
index 7e69eb9992b762a05f37e8603c77122ec9622cc6..c2b9a8d8b2c9adafce6c8161b325edaa8c184986 100644 (file)
@@ -199,7 +199,7 @@ bp_unpack_value (struct bitpack_d *bp, unsigned nbits)
 inline poly_int<NUM_POLY_INT_COEFFS, bitpack_word_t>
 bp_unpack_poly_value (struct bitpack_d *bp, unsigned nbits)
 {
-  poly_int_pod<NUM_POLY_INT_COEFFS, bitpack_word_t> x;
+  poly_int<NUM_POLY_INT_COEFFS, bitpack_word_t> x;
   for (int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
     x.coeffs[i] = bp_unpack_value (bp, nbits);
   return x;
index f1777c0a4cf1c668d5fe666095b25ef00fb77b61..d52088b3e721555155b839eba49042740b38b999 100644 (file)
@@ -112,8 +112,8 @@ struct dw_trace_info
      while scanning insns.  However, the args_size value is irrelevant at
      any point except can_throw_internal_p insns.  Therefore the "delay"
      sizes the values that must actually be emitted for this trace.  */
-  poly_int64_pod beg_true_args_size, end_true_args_size;
-  poly_int64_pod beg_delay_args_size, end_delay_args_size;
+  poly_int64 beg_true_args_size, end_true_args_size;
+  poly_int64 beg_delay_args_size, end_delay_args_size;
 
   /* The first EH insn in the trace, where beg_delay_args_size must be set.  */
   rtx_insn *eh_head;
@@ -219,7 +219,7 @@ static dw_cfa_location *cur_cfa;
 struct queued_reg_save {
   rtx reg;
   rtx saved_reg;
-  poly_int64_pod cfa_offset;
+  poly_int64 cfa_offset;
 };
 
 
index 61a996050ff988d96bd748f9694fc50bb8d2204a..05ae0d7f34e2b7310cd3660f7480c13367d66bb8 100644 (file)
@@ -158,8 +158,8 @@ struct GTY(()) cfa_reg {
    Instead of passing around REG and OFFSET, we pass a copy
    of this structure.  */
 struct GTY(()) dw_cfa_location {
-  poly_int64_pod offset;
-  poly_int64_pod base_offset;
+  poly_int64 offset;
+  poly_int64 base_offset;
   /* REG is in DWARF_FRAME_REGNUM space, *not* normal REGNO space.  */
   struct cfa_reg reg;
   BOOL_BITFIELD indirect : 1;  /* 1 if CFA is accessed via a dereference.  */
index af62f21f1d503994ef4fbf5883e2fe978f43f7f0..c11a6f3eb62cfb42b139060ca36144cd87397aca 100644 (file)
@@ -30,12 +30,12 @@ struct GTY(()) incoming_args {
   /* Number of bytes of args popped by function being compiled on its return.
      Zero if no bytes are to be popped.
      May affect compilation of return insn or of function epilogue.  */
-  poly_int64_pod pops_args;
+  poly_int64 pops_args;
 
   /* If function's args have a fixed size, this is that size, in bytes.
      Otherwise, it is -1.
      May affect compilation of return insn or of function epilogue.  */
-  poly_int64_pod size;
+  poly_int64 size;
 
   /* # bytes the prologue should push and pretend that the caller pushed them.
      The prologue must do this, but only if parms can be passed in
@@ -80,7 +80,7 @@ struct GTY(()) rtl_data {
 
   /* # of bytes of outgoing arguments.  If ACCUMULATE_OUTGOING_ARGS is
      defined, the needed space is pushed by the prologue.  */
-  poly_int64_pod outgoing_args_size;
+  poly_int64 outgoing_args_size;
 
   /* If nonzero, an RTL expression for the location at which the current
      function returns its result.  If the current function returns its
@@ -139,7 +139,7 @@ struct GTY(()) rtl_data {
   /* Offset to end of allocated area of stack frame.
      If stack grows down, this is the address of the last stack slot allocated.
      If stack grows up, this is the address for the next slot.  */
-  poly_int64_pod x_frame_offset;
+  poly_int64 x_frame_offset;
 
   /* Insn after which register parms and SAVE_EXPRs are born, if nonopt.  */
   rtx_insn *x_parm_birth_insn;
index 2c9930ec674431b579cf842c6209c1e271bd8309..4220cbd9f8f0273f62a01c64a64442ebb8589562 100644 (file)
@@ -5438,8 +5438,8 @@ optimize_bitfield_assignment_op (poly_uint64 pbitsize,
    *BITSTART and *BITEND.  */
 
 void
-get_bit_range (poly_uint64_pod *bitstart, poly_uint64_pod *bitend, tree exp,
-              poly_int64_pod *bitpos, tree *offset)
+get_bit_range (poly_uint64 *bitstart, poly_uint64 *bitend, tree exp,
+              poly_int64 *bitpos, tree *offset)
 {
   poly_int64 bitoffset;
   tree field, repr;
@@ -7881,8 +7881,8 @@ store_field (rtx target, poly_int64 bitsize, poly_int64 bitpos,
    this case, but the address of the object can be found.  */
 
 tree
-get_inner_reference (tree exp, poly_int64_pod *pbitsize,
-                    poly_int64_pod *pbitpos, tree *poffset,
+get_inner_reference (tree exp, poly_int64 *pbitsize,
+                    poly_int64 *pbitpos, tree *poffset,
                     machine_mode *pmode, int *punsignedp,
                     int *preversep, int *pvolatilep)
 {
index 11bff5318620685388af5ea526e34282e3abb165..2a172867fdb0825ce59b68891f1bce1814f70020 100644 (file)
@@ -275,8 +275,8 @@ extern bool emit_push_insn (rtx, machine_mode, tree, rtx, unsigned int,
                            int, rtx, poly_int64, rtx, rtx, int, rtx, bool);
 
 /* Extract the accessible bit-range from a COMPONENT_REF.  */
-extern void get_bit_range (poly_uint64_pod *, poly_uint64_pod *, tree,
-                          poly_int64_pod *, tree *);
+extern void get_bit_range (poly_uint64 *, poly_uint64 *, tree,
+                          poly_int64 *, tree *);
 
 /* Expand an assignment that stores the value of FROM into TO.  */
 extern void expand_assignment (tree, tree, bool);
index c5ac82200c8e0f2fcb69c315165a5d860c91a631..4f8561509ffb2abf1ace960544151790f25bf9f8 100644 (file)
@@ -16564,7 +16564,7 @@ round_down_loc (location_t loc, tree value, int divisor)
 
 static tree
 split_address_to_core_and_offset (tree exp,
-                                 poly_int64_pod *pbitpos, tree *poffset)
+                                 poly_int64 *pbitpos, tree *poffset)
 {
   tree core;
   machine_mode mode;
@@ -16614,7 +16614,7 @@ split_address_to_core_and_offset (tree exp,
    otherwise.  If they do, E1 - E2 is stored in *DIFF.  */
 
 bool
-ptr_difference_const (tree e1, tree e2, poly_int64_pod *diff)
+ptr_difference_const (tree e1, tree e2, poly_int64 *diff)
 {
   tree core1, core2;
   poly_int64 bitpos1, bitpos2;
index 3d08528a20cc7050c47d91014c8b731cd0a94b9e..50f901d6e1f1b34379665f48654b11f7e96175e7 100644 (file)
@@ -151,7 +151,7 @@ extern tree div_if_zero_remainder (const_tree, const_tree);
 extern bool tree_swap_operands_p (const_tree, const_tree);
 extern enum tree_code swap_tree_comparison (enum tree_code);
 
-extern bool ptr_difference_const (tree, tree, poly_int64_pod *);
+extern bool ptr_difference_const (tree, tree, poly_int64 *);
 extern enum tree_code invert_tree_comparison (enum tree_code, bool);
 extern bool inverse_conditions_p (const_tree, const_tree);
 
index e92384a8907a51f74569c8059ff2db815538ebfe..336af28fb2281a20b82e3dfa0a6281253cdab43a 100644 (file)
@@ -300,7 +300,7 @@ get_stack_local_alignment (tree type, machine_mode mode)
 static bool
 try_fit_stack_local (poly_int64 start, poly_int64 length,
                     poly_int64 size, unsigned int alignment,
-                    poly_int64_pod *poffset)
+                    poly_int64 *poffset)
 {
   poly_int64 this_frame_offset;
   int frame_off, frame_alignment, frame_phase;
@@ -1431,7 +1431,7 @@ static poly_int64 cfa_offset;
    offset indirectly through the pointer.  Otherwise, return 0.  */
 
 static rtx
-instantiate_new_reg (rtx x, poly_int64_pod *poffset)
+instantiate_new_reg (rtx x, poly_int64 *poffset)
 {
   rtx new_rtx;
   poly_int64 offset;
index e290ff5e59f3830a1ca73aaf4087b6dd579beb19..5caf1e153eabc1ec654bf1b1964d64ea9f33b411 100644 (file)
@@ -94,7 +94,7 @@ extern GTY ((length ("crtl->emit.x_reg_rtx_no"))) rtx * regno_reg_rtx;
 struct GTY(()) expr_status {
   /* Number of units that we should eventually pop off the stack.
      These are the arguments to function calls that have already returned.  */
-  poly_int64_pod x_pending_stack_adjust;
+  poly_int64 x_pending_stack_adjust;
 
   /* Under some ABIs, it is the caller's responsibility to pop arguments
      pushed for function calls.  A naive implementation would simply pop
@@ -117,7 +117,7 @@ struct GTY(()) expr_status {
      boundary can be momentarily unaligned while pushing the arguments.
      Record the delta since last aligned boundary here in order to get
      stack alignment in the nested function calls working right.  */
-  poly_int64_pod x_stack_pointer_delta;
+  poly_int64 x_stack_pointer_delta;
 
   /* Nonzero means __builtin_saveregs has already been done in this function.
      The value is the pseudoreg containing the value __builtin_saveregs
@@ -537,7 +537,7 @@ extern struct machine_function * (*init_machine_status) (void);
 
 struct args_size
 {
-  poly_int64_pod constant;
+  poly_int64 constant;
   tree var;
 };
 
index 3db0a9b07691720f77196665d4ca83e6a7aefb7d..517d84e4ba29529a0db9dd2d707a45f09ccfb868 100644 (file)
@@ -5234,7 +5234,6 @@ main (int argc, char **argv)
       POS_HERE (do_scalar_typedef ("REAL_VALUE_TYPE", &pos));
       POS_HERE (do_scalar_typedef ("FIXED_VALUE_TYPE", &pos));
       POS_HERE (do_scalar_typedef ("double_int", &pos));
-      POS_HERE (do_scalar_typedef ("poly_int64_pod", &pos));
       POS_HERE (do_scalar_typedef ("offset_int", &pos));
       POS_HERE (do_scalar_typedef ("widest_int", &pos));
       POS_HERE (do_scalar_typedef ("int64_t", &pos));
index 55ac2adb5596df5f5692ec411d9d9c172415f9d0..5446a3ee7eca03078f5a2e990a792db149586f5c 100644 (file)
@@ -980,7 +980,7 @@ calc_wider_mode (void)
     }
 }
 
-/* Text to add to the constant part of a poly_int_pod initializer in
+/* Text to add to the constant part of a poly_int initializer in
    order to fill out te whole structure.  */
 #if NUM_POLY_INT_COEFFS == 1
 #define ZERO_COEFFS ""
@@ -1080,7 +1080,7 @@ extern __inline__ __attribute__((__always_inline__, __gnu_inline__))\n\
 poly_uint16\n\
 mode_size_inline (machine_mode mode)\n\
 {\n\
-  extern %spoly_uint16_pod mode_size[NUM_MACHINE_MODES];\n\
+  extern %spoly_uint16 mode_size[NUM_MACHINE_MODES];\n\
   gcc_assert (mode >= 0 && mode < NUM_MACHINE_MODES);\n\
   switch (mode)\n\
     {\n", adj_nunits || adj_bytesize ? "" : "const ");
@@ -1114,7 +1114,7 @@ extern __inline__ __attribute__((__always_inline__, __gnu_inline__))\n\
 poly_uint16\n\
 mode_nunits_inline (machine_mode mode)\n\
 {\n\
-  extern %spoly_uint16_pod mode_nunits[NUM_MACHINE_MODES];\n\
+  extern %spoly_uint16 mode_nunits[NUM_MACHINE_MODES];\n\
   switch (mode)\n\
     {\n", adj_nunits ? "" : "const ");
 
@@ -1480,7 +1480,7 @@ emit_mode_precision (void)
   int c;
   struct mode_data *m;
 
-  print_maybe_const_decl ("%spoly_uint16_pod", "mode_precision",
+  print_maybe_const_decl ("%spoly_uint16", "mode_precision",
                          "NUM_MACHINE_MODES", adj_nunits);
 
   for_all_modes (c, m)
@@ -1499,7 +1499,7 @@ emit_mode_size (void)
   int c;
   struct mode_data *m;
 
-  print_maybe_const_decl ("%spoly_uint16_pod", "mode_size",
+  print_maybe_const_decl ("%spoly_uint16", "mode_size",
                          "NUM_MACHINE_MODES", adj_nunits || adj_bytesize);
 
   for_all_modes (c, m)
@@ -1514,7 +1514,7 @@ emit_mode_nunits (void)
   int c;
   struct mode_data *m;
 
-  print_maybe_const_decl ("%spoly_uint16_pod", "mode_nunits",
+  print_maybe_const_decl ("%spoly_uint16", "mode_nunits",
                          "NUM_MACHINE_MODES", adj_nunits);
 
   for_all_modes (c, m)
index 04d9faca8ff7466de02ec88a41d64d6ded198d68..dc89975270c34f8871eb81d938e0cb294fdcadbd 100644 (file)
@@ -7857,7 +7857,7 @@ gimple_fold_stmt_to_constant (gimple *stmt, tree (*valueize) (tree))
    is not explicitly available, but it is known to be zero
    such as 'static const int a;'.  */
 static tree
-get_base_constructor (tree base, poly_int64_pod *bit_offset,
+get_base_constructor (tree base, poly_int64 *bit_offset,
                      tree (*valueize)(tree))
 {
   poly_int64 bit_offset2, size, max_size;
index 542958dd44f485cfee48850a511c38db188e6730..fc6ce4b7084615b4a3ef78a8e05d17dfbc567233 100644 (file)
@@ -227,7 +227,7 @@ struct symbolic_number {
   tree type;
   tree base_addr;
   tree offset;
-  poly_int64_pod bytepos;
+  poly_int64 bytepos;
   tree src;
   tree alias_set;
   tree vuse;
index 41ae153d1c59f2c9bc25a569ebaf47d14dfd16c0..dc594da7eaebc31e8bd386339bb20fccf17a3aaa 100644 (file)
@@ -59,7 +59,7 @@ class hash
 
   /* Add polynomial value V, treating each element as an unsigned int.  */
   template<unsigned int N, typename T>
-  void add_poly_int (const poly_int_pod<N, T> &v)
+  void add_poly_int (const poly_int<N, T> &v)
   {
     for (unsigned int i = 0; i < N; ++i)
       add_int (v.coeffs[i]);
@@ -73,7 +73,7 @@ class hash
 
   /* Add polynomial value V, treating each element as a HOST_WIDE_INT.  */
   template<unsigned int N, typename T>
-  void add_poly_hwi (const poly_int_pod<N, T> &v)
+  void add_poly_hwi (const poly_int<N, T> &v)
   {
     for (unsigned int i = 0; i < N; ++i)
       add_hwi (v.coeffs[i]);
index de89d879bf4e3dfd8f6fe5219873f283f2279f31..36bc803f7e5c128a3b904d48ba17473dbffc61a5 100644 (file)
@@ -653,17 +653,17 @@ modref_access_node::dump (FILE *out)
       if (parm_offset_known)
        {
          fprintf (out, " param offset:");
-         print_dec ((poly_int64_pod)parm_offset, out, SIGNED);
+         print_dec ((poly_int64)parm_offset, out, SIGNED);
        }
     }
   if (range_info_useful_p ())
     {
       fprintf (out, " offset:");
-      print_dec ((poly_int64_pod)offset, out, SIGNED);
+      print_dec ((poly_int64)offset, out, SIGNED);
       fprintf (out, " size:");
-      print_dec ((poly_int64_pod)size, out, SIGNED);
+      print_dec ((poly_int64)size, out, SIGNED);
       fprintf (out, " max_size:");
-      print_dec ((poly_int64_pod)max_size, out, SIGNED);
+      print_dec ((poly_int64)max_size, out, SIGNED);
       if (adjustments)
        fprintf (out, " adjusted %i times", adjustments);
     }
index 278b2dbd828432082959abb4fce1249dd179532b..c04f9f44c064d2f3aac9b611e45691c3059a390e 100644 (file)
@@ -1331,7 +1331,7 @@ modref_access_analysis::merge_call_side_effects
          if (parm_map[i].parm_offset_known)
            {
              fprintf (dump_file, " offset:");
-             print_dec ((poly_int64_pod)parm_map[i].parm_offset,
+             print_dec ((poly_int64)parm_map[i].parm_offset,
                         dump_file, SIGNED);
            }
        }
@@ -1347,7 +1347,7 @@ modref_access_analysis::merge_call_side_effects
          if (chain_map.parm_offset_known)
            {
              fprintf (dump_file, " offset:");
-             print_dec ((poly_int64_pod)chain_map.parm_offset,
+             print_dec ((poly_int64)chain_map.parm_offset,
                         dump_file, SIGNED);
            }
        }
index e7460cfd906ce2a0cd4ce5639b18a6411370804f..0685e1f4e8df3c1bc288579decec834b46f06f68 100644 (file)
@@ -619,7 +619,7 @@ public:
   /* RTL representation of the stack slot.  */
   rtx mem;
   /* Size of the stack slot.  */
-  poly_uint64_pod width;
+  poly_uint64 width;
 };
 
 /* The number of elements in the following array.  */
index 9ff4774cf5d30949a377629dbd50525a4995fc27..f3b75e083901746d6aeb17819c8272a63adab9d2 100644 (file)
@@ -166,7 +166,7 @@ static class lra_elim_table self_elim_table;
 /* Offsets should be used to restore original offsets for eliminable
    hard register which just became not eliminable.  Zero,
    otherwise.  */
-static poly_int64_pod self_elim_offsets[FIRST_PSEUDO_REGISTER];
+static poly_int64 self_elim_offsets[FIRST_PSEUDO_REGISTER];
 
 /* Map: hard regno -> RTL presentation.         RTL presentations of all
    potentially eliminable hard registers are stored in the map.         */
index a22df60dc200473a13fdd469def91b458c14d833..efdb6e5d54b25407fa283f7c8d74294dea0d97b5 100644 (file)
@@ -22,10 +22,10 @@ along with GCC; see the file COPYING3.  If not see
 
 typedef opt_mode<machine_mode> opt_machine_mode;
 
-extern CONST_MODE_SIZE poly_uint16_pod mode_size[NUM_MACHINE_MODES];
-extern CONST_MODE_PRECISION poly_uint16_pod mode_precision[NUM_MACHINE_MODES];
+extern CONST_MODE_SIZE poly_uint16 mode_size[NUM_MACHINE_MODES];
+extern CONST_MODE_PRECISION poly_uint16 mode_precision[NUM_MACHINE_MODES];
 extern const unsigned short mode_inner[NUM_MACHINE_MODES];
-extern CONST_MODE_NUNITS poly_uint16_pod mode_nunits[NUM_MACHINE_MODES];
+extern CONST_MODE_NUNITS poly_uint16 mode_nunits[NUM_MACHINE_MODES];
 extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];
 extern const unsigned short mode_unit_precision[NUM_MACHINE_MODES];
 extern const unsigned short mode_next[NUM_MACHINE_MODES];
index b0c3ef7a9ccf01426ae6328a8336127d35d9928d..91ef74f1f6a44bc689caaac4809409b98d394762 100644 (file)
@@ -4547,7 +4547,7 @@ public:
   tree lastlane;
   vec<tree, va_heap> simt_eargs;
   gimple_seq simt_dlist;
-  poly_uint64_pod max_vf;
+  poly_uint64 max_vf;
   bool is_simt;
 };
 
index 07e5da05671820311b5ad4a68e67b486aec1a6dc..6a41e7baf8071adf8a57240c92d06a106cccd0d4 100644 (file)
@@ -20,14 +20,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef HAVE_POLY_INT_TYPES_H
 #define HAVE_POLY_INT_TYPES_H
 
-typedef poly_int_pod<NUM_POLY_INT_COEFFS, unsigned short> poly_uint16_pod;
-typedef poly_int_pod<NUM_POLY_INT_COEFFS, HOST_WIDE_INT> poly_int64_pod;
-typedef poly_int_pod<NUM_POLY_INT_COEFFS,
-                    unsigned HOST_WIDE_INT> poly_uint64_pod;
-typedef poly_int_pod<NUM_POLY_INT_COEFFS, offset_int> poly_offset_int_pod;
-typedef poly_int_pod<NUM_POLY_INT_COEFFS, wide_int> poly_wide_int_pod;
-typedef poly_int_pod<NUM_POLY_INT_COEFFS, widest_int> poly_widest_int_pod;
-
 typedef poly_int<NUM_POLY_INT_COEFFS, unsigned short> poly_uint16;
 typedef poly_int<NUM_POLY_INT_COEFFS, HOST_WIDE_INT> poly_int64;
 typedef poly_int<NUM_POLY_INT_COEFFS, unsigned HOST_WIDE_INT> poly_uint64;
index 7bff5e5ad267b63911168ecd016fe00905d93172..3146ba3fdb539df2f365bc508ac34793ff51b316 100644 (file)
@@ -29,7 +29,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef HAVE_POLY_INT_H
 #define HAVE_POLY_INT_H
 
-template<unsigned int N, typename T> struct poly_int_pod;
 template<unsigned int N, typename T> class poly_int;
 
 /* poly_coeff_traiits<T> describes the properties of a poly_int
@@ -58,7 +57,11 @@ template<unsigned int N, typename T> class poly_int;
 
    - poly_coeff_traits<T>::result is a type that can hold results of
      operations on T.  This is different from T itself in cases where T
-     is the result of an accessor like wi::to_offset.  */
+     is the result of an accessor like wi::to_offset.
+
+   - poly_coeff_traits<T>::init_cast<Arg>::type is the type to which
+     an argument of type Arg should be casted before being used to
+     initialize a coefficient of type T.  */
 template<typename T, wi::precision_type = wi::int_traits<T>::precision_type>
 struct poly_coeff_traits;
 
@@ -74,6 +77,9 @@ struct poly_coeff_traits<T, wi::FLEXIBLE_PRECISION>
                                 + ((T (1) << (precision - 2)) - 1))
                              : T (-1));
   static const int rank = sizeof (T) * 2 + !signedness;
+
+  template<typename Arg>
+  struct init_cast { using type = T; };
 };
 
 template<typename T>
@@ -84,6 +90,9 @@ struct poly_coeff_traits<T, wi::VAR_PRECISION>
   static const int signedness = -1;
   static const int precision = WIDE_INT_MAX_PRECISION;
   static const int rank = INT_MAX;
+
+  template<typename Arg>
+  struct init_cast { using type = const Arg &; };
 };
 
 template<typename T>
@@ -95,6 +104,9 @@ struct poly_coeff_traits<T, wi::CONST_PRECISION>
   static const int signedness = 1;
   static const int precision = wi::int_traits<T>::precision;
   static const int rank = precision * 2 / CHAR_BIT;
+
+  template<typename Arg>
+  struct init_cast { using type = const Arg &; };
 };
 
 /* Information about a pair of coefficient types.  */
@@ -172,17 +184,13 @@ struct poly_int_traits
   typedef typename poly_coeff_traits<T>::int_type int_type;
 };
 template<unsigned int N, typename C>
-struct poly_int_traits<poly_int_pod<N, C> >
+struct poly_int_traits<poly_int<N, C> >
 {
   static const bool is_poly = true;
   static const unsigned int num_coeffs = N;
   typedef C coeff_type;
   typedef typename poly_coeff_traits<C>::int_type int_type;
 };
-template<unsigned int N, typename C>
-struct poly_int_traits<poly_int<N, C> > : poly_int_traits<poly_int_pod<N, C> >
-{
-};
 
 /* SFINAE class that makes T2 available as "type" if T1 is a non-polynomial
    type.  */
@@ -332,31 +340,55 @@ struct poly_result<T1, T2, 2>
    ? (void) ((RES).coeffs[I] = VALUE) \
    : (void) ((RES).coeffs[I].~C (), new (&(RES).coeffs[I]) C (VALUE)))
 
-/* A base POD class for polynomial integers.  The polynomial has N
-   coefficients of type C.  */
+/* poly_int_full and poly_int_hungry are used internally within poly_int
+   for delegated initializers.  poly_int_full indicates that a parameter
+   pack has enough elements to initialize every coefficient.  poly_int_hungry
+   indicates that at least one extra zero must be added.  */
+struct poly_int_full {};
+struct poly_int_hungry {};
+
+/* poly_int_fullness<B>::type is poly_int_full when B is true and
+   poly_int_hungry when B is false.  */
+template<bool> struct poly_int_fullness;
+template<> struct poly_int_fullness<false> { using type = poly_int_hungry; };
+template<> struct poly_int_fullness<true> { using type = poly_int_full; };
+
+/* A class containing polynomial integers.  The polynomial has N coefficients
+   of type C, and N - 1 indeterminates.  */
 template<unsigned int N, typename C>
-struct poly_int_pod
+struct poly_int
 {
 public:
+  poly_int () = default;
+  poly_int (const poly_int &) = default;
+
+  template<typename Ca>
+  poly_int (const poly_int<N, Ca> &);
+
+  template<typename ...Cs>
+  constexpr poly_int (const Cs &...);
+
+  poly_int &operator = (const poly_int &) = default;
+
   template<typename Ca>
-  poly_int_pod &operator = (const poly_int_pod<N, Ca> &);
+  poly_int &operator = (const poly_int<N, Ca> &);
   template<typename Ca>
-  typename if_nonpoly<Ca, poly_int_pod>::type &operator = (const Ca &);
+  typename if_nonpoly<Ca, poly_int>::type &operator = (const Ca &);
 
   template<typename Ca>
-  poly_int_pod &operator += (const poly_int_pod<N, Ca> &);
+  poly_int &operator += (const poly_int<N, Ca> &);
   template<typename Ca>
-  typename if_nonpoly<Ca, poly_int_pod>::type &operator += (const Ca &);
+  typename if_nonpoly<Ca, poly_int>::type &operator += (const Ca &);
 
   template<typename Ca>
-  poly_int_pod &operator -= (const poly_int_pod<N, Ca> &);
+  poly_int &operator -= (const poly_int<N, Ca> &);
   template<typename Ca>
-  typename if_nonpoly<Ca, poly_int_pod>::type &operator -= (const Ca &);
+  typename if_nonpoly<Ca, poly_int>::type &operator -= (const Ca &);
 
   template<typename Ca>
-  typename if_nonpoly<Ca, poly_int_pod>::type &operator *= (const Ca &);
+  typename if_nonpoly<Ca, poly_int>::type &operator *= (const Ca &);
 
-  poly_int_pod &operator <<= (unsigned int);
+  poly_int &operator <<= (unsigned int);
 
   bool is_constant () const;
 
@@ -366,13 +398,13 @@ public:
   C to_constant () const;
 
   template<typename Ca>
-  static poly_int<N, C> from (const poly_int_pod<N, Ca> &, unsigned int,
+  static poly_int<N, C> from (const poly_int<N, Ca> &, unsigned int,
                              signop);
   template<typename Ca>
-  static poly_int<N, C> from (const poly_int_pod<N, Ca> &, signop);
+  static poly_int<N, C> from (const poly_int<N, Ca> &, signop);
 
-  bool to_shwi (poly_int_pod<N, HOST_WIDE_INT> *) const;
-  bool to_uhwi (poly_int_pod<N, unsigned HOST_WIDE_INT> *) const;
+  bool to_shwi (poly_int<N, HOST_WIDE_INT> *) const;
+  bool to_uhwi (poly_int<N, unsigned HOST_WIDE_INT> *) const;
   poly_int<N, HOST_WIDE_INT> force_shwi () const;
   poly_int<N, unsigned HOST_WIDE_INT> force_uhwi () const;
 
@@ -381,12 +413,50 @@ public:
 #endif
 
   C coeffs[N];
+
+private:
+  template<typename ...Cs>
+  constexpr poly_int (poly_int_full, const Cs &...);
+
+  template<typename C0, typename ...Cs>
+  constexpr poly_int (poly_int_hungry, const C0 &, const Cs &...);
 };
 
 template<unsigned int N, typename C>
 template<typename Ca>
-inline poly_int_pod<N, C>&
-poly_int_pod<N, C>::operator = (const poly_int_pod<N, Ca> &a)
+inline
+poly_int<N, C>::poly_int (const poly_int<N, Ca> &a)
+{
+  for (unsigned int i = 0; i < N; i++)
+    POLY_SET_COEFF (C, *this, i, a.coeffs[i]);
+}
+
+template<unsigned int N, typename C>
+template<typename ...Cs>
+inline constexpr
+poly_int<N, C>::poly_int (const Cs &... cs)
+  : poly_int (typename poly_int_fullness<sizeof... (Cs) >= N>::type (),
+             cs...) {}
+
+/* Initialize with c0, cs..., and some trailing zeros.  */
+template<unsigned int N, typename C>
+template<typename C0, typename ...Cs>
+inline constexpr
+poly_int<N, C>::poly_int (poly_int_hungry, const C0 &c0, const Cs &... cs)
+  : poly_int (c0, cs..., wi::ints_for<C>::zero (c0)) {}
+
+/* Initialize with cs... directly, casting where necessary.  */
+template<unsigned int N, typename C>
+template<typename ...Cs>
+inline constexpr
+poly_int<N, C>::poly_int (poly_int_full, const Cs &... cs)
+  : coeffs { (typename poly_coeff_traits<C>::
+             template init_cast<Cs>::type (cs))... } {}
+
+template<unsigned int N, typename C>
+template<typename Ca>
+inline poly_int<N, C>&
+poly_int<N, C>::operator = (const poly_int<N, Ca> &a)
 {
   for (unsigned int i = 0; i < N; i++)
     POLY_SET_COEFF (C, *this, i, a.coeffs[i]);
@@ -395,8 +465,8 @@ poly_int_pod<N, C>::operator = (const poly_int_pod<N, Ca> &a)
 
 template<unsigned int N, typename C>
 template<typename Ca>
-inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type &
-poly_int_pod<N, C>::operator = (const Ca &a)
+inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
+poly_int<N, C>::operator = (const Ca &a)
 {
   POLY_SET_COEFF (C, *this, 0, a);
   if (N >= 2)
@@ -407,8 +477,8 @@ poly_int_pod<N, C>::operator = (const Ca &a)
 
 template<unsigned int N, typename C>
 template<typename Ca>
-inline poly_int_pod<N, C>&
-poly_int_pod<N, C>::operator += (const poly_int_pod<N, Ca> &a)
+inline poly_int<N, C>&
+poly_int<N, C>::operator += (const poly_int<N, Ca> &a)
 {
   for (unsigned int i = 0; i < N; i++)
     this->coeffs[i] += a.coeffs[i];
@@ -417,8 +487,8 @@ poly_int_pod<N, C>::operator += (const poly_int_pod<N, Ca> &a)
 
 template<unsigned int N, typename C>
 template<typename Ca>
-inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type &
-poly_int_pod<N, C>::operator += (const Ca &a)
+inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
+poly_int<N, C>::operator += (const Ca &a)
 {
   this->coeffs[0] += a;
   return *this;
@@ -426,8 +496,8 @@ poly_int_pod<N, C>::operator += (const Ca &a)
 
 template<unsigned int N, typename C>
 template<typename Ca>
-inline poly_int_pod<N, C>&
-poly_int_pod<N, C>::operator -= (const poly_int_pod<N, Ca> &a)
+inline poly_int<N, C>&
+poly_int<N, C>::operator -= (const poly_int<N, Ca> &a)
 {
   for (unsigned int i = 0; i < N; i++)
     this->coeffs[i] -= a.coeffs[i];
@@ -436,8 +506,8 @@ poly_int_pod<N, C>::operator -= (const poly_int_pod<N, Ca> &a)
 
 template<unsigned int N, typename C>
 template<typename Ca>
-inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type &
-poly_int_pod<N, C>::operator -= (const Ca &a)
+inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
+poly_int<N, C>::operator -= (const Ca &a)
 {
   this->coeffs[0] -= a;
   return *this;
@@ -445,8 +515,8 @@ poly_int_pod<N, C>::operator -= (const Ca &a)
 
 template<unsigned int N, typename C>
 template<typename Ca>
-inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type &
-poly_int_pod<N, C>::operator *= (const Ca &a)
+inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
+poly_int<N, C>::operator *= (const Ca &a)
 {
   for (unsigned int i = 0; i < N; i++)
     this->coeffs[i] *= a;
@@ -454,8 +524,8 @@ poly_int_pod<N, C>::operator *= (const Ca &a)
 }
 
 template<unsigned int N, typename C>
-inline poly_int_pod<N, C>&
-poly_int_pod<N, C>::operator <<= (unsigned int a)
+inline poly_int<N, C>&
+poly_int<N, C>::operator <<= (unsigned int a)
 {
   for (unsigned int i = 0; i < N; i++)
     this->coeffs[i] <<= a;
@@ -466,7 +536,7 @@ poly_int_pod<N, C>::operator <<= (unsigned int a)
 
 template<unsigned int N, typename C>
 inline bool
-poly_int_pod<N, C>::is_constant () const
+poly_int<N, C>::is_constant () const
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
@@ -481,7 +551,7 @@ poly_int_pod<N, C>::is_constant () const
 template<unsigned int N, typename C>
 template<typename T>
 inline typename if_lossless<T, C, bool>::type
-poly_int_pod<N, C>::is_constant (T *const_value) const
+poly_int<N, C>::is_constant (T *const_value) const
 {
   if (is_constant ())
     {
@@ -499,7 +569,7 @@ poly_int_pod<N, C>::is_constant (T *const_value) const
 
 template<unsigned int N, typename C>
 inline C
-poly_int_pod<N, C>::to_constant () const
+poly_int<N, C>::to_constant () const
 {
   gcc_checking_assert (is_constant ());
   return this->coeffs[0];
@@ -512,8 +582,8 @@ poly_int_pod<N, C>::to_constant () const
 template<unsigned int N, typename C>
 template<typename Ca>
 inline poly_int<N, C>
-poly_int_pod<N, C>::from (const poly_int_pod<N, Ca> &a,
-                         unsigned int bitsize, signop sgn)
+poly_int<N, C>::from (const poly_int<N, Ca> &a, unsigned int bitsize,
+                     signop sgn)
 {
   poly_int<N, C> r;
   for (unsigned int i = 0; i < N; i++)
@@ -527,7 +597,7 @@ poly_int_pod<N, C>::from (const poly_int_pod<N, Ca> &a,
 template<unsigned int N, typename C>
 template<typename Ca>
 inline poly_int<N, C>
-poly_int_pod<N, C>::from (const poly_int_pod<N, Ca> &a, signop sgn)
+poly_int<N, C>::from (const poly_int<N, Ca> &a, signop sgn)
 {
   poly_int<N, C> r;
   for (unsigned int i = 0; i < N; i++)
@@ -541,7 +611,7 @@ poly_int_pod<N, C>::from (const poly_int_pod<N, Ca> &a, signop sgn)
 
 template<unsigned int N, typename C>
 inline bool
-poly_int_pod<N, C>::to_shwi (poly_int_pod<N, HOST_WIDE_INT> *r) const
+poly_int<N, C>::to_shwi (poly_int<N, HOST_WIDE_INT> *r) const
 {
   for (unsigned int i = 0; i < N; i++)
     if (!wi::fits_shwi_p (this->coeffs[i]))
@@ -558,7 +628,7 @@ poly_int_pod<N, C>::to_shwi (poly_int_pod<N, HOST_WIDE_INT> *r) const
 
 template<unsigned int N, typename C>
 inline bool
-poly_int_pod<N, C>::to_uhwi (poly_int_pod<N, unsigned HOST_WIDE_INT> *r) const
+poly_int<N, C>::to_uhwi (poly_int<N, unsigned HOST_WIDE_INT> *r) const
 {
   for (unsigned int i = 0; i < N; i++)
     if (!wi::fits_uhwi_p (this->coeffs[i]))
@@ -573,9 +643,9 @@ poly_int_pod<N, C>::to_uhwi (poly_int_pod<N, unsigned HOST_WIDE_INT> *r) const
 
 template<unsigned int N, typename C>
 inline poly_int<N, HOST_WIDE_INT>
-poly_int_pod<N, C>::force_shwi () const
+poly_int<N, C>::force_shwi () const
 {
-  poly_int_pod<N, HOST_WIDE_INT> r;
+  poly_int<N, HOST_WIDE_INT> r;
   for (unsigned int i = 0; i < N; i++)
     r.coeffs[i] = this->coeffs[i].to_shwi ();
   return r;
@@ -586,9 +656,9 @@ poly_int_pod<N, C>::force_shwi () const
 
 template<unsigned int N, typename C>
 inline poly_int<N, unsigned HOST_WIDE_INT>
-poly_int_pod<N, C>::force_uhwi () const
+poly_int<N, C>::force_uhwi () const
 {
-  poly_int_pod<N, unsigned HOST_WIDE_INT> r;
+  poly_int<N, unsigned HOST_WIDE_INT> r;
   for (unsigned int i = 0; i < N; i++)
     r.coeffs[i] = this->coeffs[i].to_uhwi ();
   return r;
@@ -599,170 +669,13 @@ poly_int_pod<N, C>::force_uhwi () const
 
 template<unsigned int N, typename C>
 inline
-poly_int_pod<N, C>::operator C () const
+poly_int<N, C>::operator C () const
 {
   gcc_checking_assert (this->is_constant ());
   return this->coeffs[0];
 }
 #endif
 
-/* The main class for polynomial integers.  The class provides
-   constructors that are necessarily missing from the POD base.  */
-template<unsigned int N, typename C>
-class poly_int : public poly_int_pod<N, C>
-{
-public:
-  poly_int () {}
-
-  template<typename Ca>
-  poly_int (const poly_int<N, Ca> &);
-  template<typename Ca>
-  poly_int (const poly_int_pod<N, Ca> &);
-  template<typename C0>
-  poly_int (const C0 &);
-  template<typename C0, typename C1>
-  poly_int (const C0 &, const C1 &);
-
-  template<typename Ca>
-  poly_int &operator = (const poly_int_pod<N, Ca> &);
-  template<typename Ca>
-  typename if_nonpoly<Ca, poly_int>::type &operator = (const Ca &);
-
-  template<typename Ca>
-  poly_int &operator += (const poly_int_pod<N, Ca> &);
-  template<typename Ca>
-  typename if_nonpoly<Ca, poly_int>::type &operator += (const Ca &);
-
-  template<typename Ca>
-  poly_int &operator -= (const poly_int_pod<N, Ca> &);
-  template<typename Ca>
-  typename if_nonpoly<Ca, poly_int>::type &operator -= (const Ca &);
-
-  template<typename Ca>
-  typename if_nonpoly<Ca, poly_int>::type &operator *= (const Ca &);
-
-  poly_int &operator <<= (unsigned int);
-};
-
-template<unsigned int N, typename C>
-template<typename Ca>
-inline
-poly_int<N, C>::poly_int (const poly_int<N, Ca> &a)
-{
-  for (unsigned int i = 0; i < N; i++)
-    POLY_SET_COEFF (C, *this, i, a.coeffs[i]);
-}
-
-template<unsigned int N, typename C>
-template<typename Ca>
-inline
-poly_int<N, C>::poly_int (const poly_int_pod<N, Ca> &a)
-{
-  for (unsigned int i = 0; i < N; i++)
-    POLY_SET_COEFF (C, *this, i, a.coeffs[i]);
-}
-
-template<unsigned int N, typename C>
-template<typename C0>
-inline
-poly_int<N, C>::poly_int (const C0 &c0)
-{
-  POLY_SET_COEFF (C, *this, 0, c0);
-  for (unsigned int i = 1; i < N; i++)
-    POLY_SET_COEFF (C, *this, i, wi::ints_for<C>::zero (this->coeffs[0]));
-}
-
-template<unsigned int N, typename C>
-template<typename C0, typename C1>
-inline
-poly_int<N, C>::poly_int (const C0 &c0, const C1 &c1)
-{
-  STATIC_ASSERT (N >= 2);
-  POLY_SET_COEFF (C, *this, 0, c0);
-  POLY_SET_COEFF (C, *this, 1, c1);
-  for (unsigned int i = 2; i < N; i++)
-    POLY_SET_COEFF (C, *this, i, wi::ints_for<C>::zero (this->coeffs[0]));
-}
-
-template<unsigned int N, typename C>
-template<typename Ca>
-inline poly_int<N, C>&
-poly_int<N, C>::operator = (const poly_int_pod<N, Ca> &a)
-{
-  for (unsigned int i = 0; i < N; i++)
-    this->coeffs[i] = a.coeffs[i];
-  return *this;
-}
-
-template<unsigned int N, typename C>
-template<typename Ca>
-inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
-poly_int<N, C>::operator = (const Ca &a)
-{
-  this->coeffs[0] = a;
-  if (N >= 2)
-    for (unsigned int i = 1; i < N; i++)
-      this->coeffs[i] = wi::ints_for<C>::zero (this->coeffs[0]);
-  return *this;
-}
-
-template<unsigned int N, typename C>
-template<typename Ca>
-inline poly_int<N, C>&
-poly_int<N, C>::operator += (const poly_int_pod<N, Ca> &a)
-{
-  for (unsigned int i = 0; i < N; i++)
-    this->coeffs[i] += a.coeffs[i];
-  return *this;
-}
-
-template<unsigned int N, typename C>
-template<typename Ca>
-inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
-poly_int<N, C>::operator += (const Ca &a)
-{
-  this->coeffs[0] += a;
-  return *this;
-}
-
-template<unsigned int N, typename C>
-template<typename Ca>
-inline poly_int<N, C>&
-poly_int<N, C>::operator -= (const poly_int_pod<N, Ca> &a)
-{
-  for (unsigned int i = 0; i < N; i++)
-    this->coeffs[i] -= a.coeffs[i];
-  return *this;
-}
-
-template<unsigned int N, typename C>
-template<typename Ca>
-inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
-poly_int<N, C>::operator -= (const Ca &a)
-{
-  this->coeffs[0] -= a;
-  return *this;
-}
-
-template<unsigned int N, typename C>
-template<typename Ca>
-inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
-poly_int<N, C>::operator *= (const Ca &a)
-{
-  for (unsigned int i = 0; i < N; i++)
-    this->coeffs[i] *= a;
-  return *this;
-}
-
-template<unsigned int N, typename C>
-inline poly_int<N, C>&
-poly_int<N, C>::operator <<= (unsigned int a)
-{
-  for (unsigned int i = 0; i < N; i++)
-    this->coeffs[i] <<= a;
-  return *this;
-}
-
 /* Return true if every coefficient of A is in the inclusive range [B, C].  */
 
 template<typename Ca, typename Cb, typename Cc>
@@ -774,7 +687,7 @@ coeffs_in_range_p (const Ca &a, const Cb &b, const Cc &c)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cc>
 inline typename if_nonpoly<Ca, bool>::type
-coeffs_in_range_p (const poly_int_pod<N, Ca> &a, const Cb &b, const Cc &c)
+coeffs_in_range_p (const poly_int<N, Ca> &a, const Cb &b, const Cc &c)
 {
   for (unsigned int i = 0; i < N; i++)
     if (a.coeffs[i] < b || a.coeffs[i] > c)
@@ -787,7 +700,7 @@ namespace wi {
 
 template<unsigned int N>
 inline poly_int<N, hwi_with_prec>
-shwi (const poly_int_pod<N, HOST_WIDE_INT> &a, unsigned int precision)
+shwi (const poly_int<N, HOST_WIDE_INT> &a, unsigned int precision)
 {
   poly_int<N, hwi_with_prec> r;
   for (unsigned int i = 0; i < N; i++)
@@ -799,7 +712,7 @@ shwi (const poly_int_pod<N, HOST_WIDE_INT> &a, unsigned int precision)
 
 template<unsigned int N>
 inline poly_int<N, hwi_with_prec>
-uhwi (const poly_int_pod<N, unsigned HOST_WIDE_INT> &a, unsigned int precision)
+uhwi (const poly_int<N, unsigned HOST_WIDE_INT> &a, unsigned int precision)
 {
   poly_int<N, hwi_with_prec> r;
   for (unsigned int i = 0; i < N; i++)
@@ -811,7 +724,7 @@ uhwi (const poly_int_pod<N, unsigned HOST_WIDE_INT> &a, unsigned int precision)
 
 template<unsigned int N, typename Ca>
 inline POLY_POLY_RESULT (N, Ca, Ca)
-sext (const poly_int_pod<N, Ca> &a, unsigned int precision)
+sext (const poly_int<N, Ca> &a, unsigned int precision)
 {
   typedef POLY_POLY_COEFF (Ca, Ca) C;
   poly_int<N, C> r;
@@ -824,7 +737,7 @@ sext (const poly_int_pod<N, Ca> &a, unsigned int precision)
 
 template<unsigned int N, typename Ca>
 inline POLY_POLY_RESULT (N, Ca, Ca)
-zext (const poly_int_pod<N, Ca> &a, unsigned int precision)
+zext (const poly_int<N, Ca> &a, unsigned int precision)
 {
   typedef POLY_POLY_COEFF (Ca, Ca) C;
   poly_int<N, C> r;
@@ -836,7 +749,7 @@ zext (const poly_int_pod<N, Ca> &a, unsigned int precision)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_POLY_RESULT (N, Ca, Cb)
-operator + (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+operator + (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_POLY_COEFF (Ca, Cb) C;
@@ -848,7 +761,7 @@ operator + (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_CONST_RESULT (N, Ca, Cb)
-operator + (const poly_int_pod<N, Ca> &a, const Cb &b)
+operator + (const poly_int<N, Ca> &a, const Cb &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CONST_COEFF (Ca, Cb) C;
@@ -862,7 +775,7 @@ operator + (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline CONST_POLY_RESULT (N, Ca, Cb)
-operator + (const Ca &a, const poly_int_pod<N, Cb> &b)
+operator + (const Ca &a, const poly_int<N, Cb> &b)
 {
   typedef POLY_CAST (Cb, Ca) NCb;
   typedef CONST_POLY_COEFF (Ca, Cb) C;
@@ -879,7 +792,7 @@ namespace wi {
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-add (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+add (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
   poly_int<N, C> r;
@@ -890,7 +803,7 @@ add (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-add (const poly_int_pod<N, Ca> &a, const Cb &b)
+add (const poly_int<N, Ca> &a, const Cb &b)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
   poly_int<N, C> r;
@@ -903,7 +816,7 @@ add (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-add (const Ca &a, const poly_int_pod<N, Cb> &b)
+add (const Ca &a, const poly_int<N, Cb> &b)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
   poly_int<N, C> r;
@@ -916,7 +829,7 @@ add (const Ca &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-add (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b,
+add (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b,
      signop sgn, wi::overflow_type *overflow)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
@@ -935,7 +848,7 @@ add (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b,
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_POLY_RESULT (N, Ca, Cb)
-operator - (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+operator - (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_POLY_COEFF (Ca, Cb) C;
@@ -947,7 +860,7 @@ operator - (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_CONST_RESULT (N, Ca, Cb)
-operator - (const poly_int_pod<N, Ca> &a, const Cb &b)
+operator - (const poly_int<N, Ca> &a, const Cb &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CONST_COEFF (Ca, Cb) C;
@@ -961,7 +874,7 @@ operator - (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline CONST_POLY_RESULT (N, Ca, Cb)
-operator - (const Ca &a, const poly_int_pod<N, Cb> &b)
+operator - (const Ca &a, const poly_int<N, Cb> &b)
 {
   typedef POLY_CAST (Cb, Ca) NCb;
   typedef CONST_POLY_COEFF (Ca, Cb) C;
@@ -978,7 +891,7 @@ namespace wi {
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-sub (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+sub (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
   poly_int<N, C> r;
@@ -989,7 +902,7 @@ sub (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-sub (const poly_int_pod<N, Ca> &a, const Cb &b)
+sub (const poly_int<N, Ca> &a, const Cb &b)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
   poly_int<N, C> r;
@@ -1002,7 +915,7 @@ sub (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-sub (const Ca &a, const poly_int_pod<N, Cb> &b)
+sub (const Ca &a, const poly_int<N, Cb> &b)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
   poly_int<N, C> r;
@@ -1015,7 +928,7 @@ sub (const Ca &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-sub (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b,
+sub (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b,
      signop sgn, wi::overflow_type *overflow)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
@@ -1034,7 +947,7 @@ sub (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b,
 
 template<unsigned int N, typename Ca>
 inline POLY_POLY_RESULT (N, Ca, Ca)
-operator - (const poly_int_pod<N, Ca> &a)
+operator - (const poly_int<N, Ca> &a)
 {
   typedef POLY_CAST (Ca, Ca) NCa;
   typedef POLY_POLY_COEFF (Ca, Ca) C;
@@ -1049,7 +962,7 @@ namespace wi {
 
 template<unsigned int N, typename Ca>
 inline poly_int<N, WI_UNARY_RESULT (Ca)>
-neg (const poly_int_pod<N, Ca> &a)
+neg (const poly_int<N, Ca> &a)
 {
   typedef WI_UNARY_RESULT (Ca) C;
   poly_int<N, C> r;
@@ -1060,7 +973,7 @@ neg (const poly_int_pod<N, Ca> &a)
 
 template<unsigned int N, typename Ca>
 inline poly_int<N, WI_UNARY_RESULT (Ca)>
-neg (const poly_int_pod<N, Ca> &a, wi::overflow_type *overflow)
+neg (const poly_int<N, Ca> &a, wi::overflow_type *overflow)
 {
   typedef WI_UNARY_RESULT (Ca) C;
   poly_int<N, C> r;
@@ -1077,7 +990,7 @@ neg (const poly_int_pod<N, Ca> &a, wi::overflow_type *overflow)
 
 template<unsigned int N, typename Ca>
 inline POLY_POLY_RESULT (N, Ca, Ca)
-operator ~ (const poly_int_pod<N, Ca> &a)
+operator ~ (const poly_int<N, Ca> &a)
 {
   if (N >= 2)
     return -1 - a;
@@ -1086,7 +999,7 @@ operator ~ (const poly_int_pod<N, Ca> &a)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_CONST_RESULT (N, Ca, Cb)
-operator * (const poly_int_pod<N, Ca> &a, const Cb &b)
+operator * (const poly_int<N, Ca> &a, const Cb &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CONST_COEFF (Ca, Cb) C;
@@ -1098,7 +1011,7 @@ operator * (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline CONST_POLY_RESULT (N, Ca, Cb)
-operator * (const Ca &a, const poly_int_pod<N, Cb> &b)
+operator * (const Ca &a, const poly_int<N, Cb> &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef CONST_POLY_COEFF (Ca, Cb) C;
@@ -1113,7 +1026,7 @@ namespace wi {
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-mul (const poly_int_pod<N, Ca> &a, const Cb &b)
+mul (const poly_int<N, Ca> &a, const Cb &b)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
   poly_int<N, C> r;
@@ -1124,7 +1037,7 @@ mul (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-mul (const Ca &a, const poly_int_pod<N, Cb> &b)
+mul (const Ca &a, const poly_int<N, Cb> &b)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
   poly_int<N, C> r;
@@ -1135,7 +1048,7 @@ mul (const Ca &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)>
-mul (const poly_int_pod<N, Ca> &a, const Cb &b,
+mul (const poly_int<N, Ca> &a, const Cb &b,
      signop sgn, wi::overflow_type *overflow)
 {
   typedef WI_BINARY_RESULT (Ca, Cb) C;
@@ -1153,7 +1066,7 @@ mul (const poly_int_pod<N, Ca> &a, const Cb &b,
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_POLY_RESULT (N, Ca, Ca)
-operator << (const poly_int_pod<N, Ca> &a, const Cb &b)
+operator << (const poly_int<N, Ca> &a, const Cb &b)
 {
   typedef POLY_CAST (Ca, Ca) NCa;
   typedef POLY_POLY_COEFF (Ca, Ca) C;
@@ -1168,7 +1081,7 @@ namespace wi {
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, WI_BINARY_RESULT (Ca, Ca)>
-lshift (const poly_int_pod<N, Ca> &a, const Cb &b)
+lshift (const poly_int<N, Ca> &a, const Cb &b)
 {
   typedef WI_BINARY_RESULT (Ca, Ca) C;
   poly_int<N, C> r;
@@ -1184,7 +1097,7 @@ template<unsigned int N, typename C>
 inline poly_int<N, HOST_WIDE_INT>
 sext_hwi (const poly_int<N, C> &a, unsigned int precision)
 {
-  poly_int_pod<N, HOST_WIDE_INT> r;
+  poly_int<N, HOST_WIDE_INT> r;
   for (unsigned int i = 0; i < N; i++)
     r.coeffs[i] = sext_hwi (a.coeffs[i], precision);
   return r;
@@ -1236,7 +1149,7 @@ maybe_eq_2 (const Ca &a0, const Ca &a1, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline bool
-maybe_eq (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+maybe_eq (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   STATIC_ASSERT (N <= 2);
   if (N == 2)
@@ -1246,7 +1159,7 @@ maybe_eq (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Cb, bool>::type
-maybe_eq (const poly_int_pod<N, Ca> &a, const Cb &b)
+maybe_eq (const poly_int<N, Ca> &a, const Cb &b)
 {
   STATIC_ASSERT (N <= 2);
   if (N == 2)
@@ -1256,7 +1169,7 @@ maybe_eq (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Ca, bool>::type
-maybe_eq (const Ca &a, const poly_int_pod<N, Cb> &b)
+maybe_eq (const Ca &a, const poly_int<N, Cb> &b)
 {
   STATIC_ASSERT (N <= 2);
   if (N == 2)
@@ -1275,7 +1188,7 @@ maybe_eq (const Ca &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline bool
-maybe_ne (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+maybe_ne (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
@@ -1286,7 +1199,7 @@ maybe_ne (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Cb, bool>::type
-maybe_ne (const poly_int_pod<N, Ca> &a, const Cb &b)
+maybe_ne (const poly_int<N, Ca> &a, const Cb &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
@@ -1297,7 +1210,7 @@ maybe_ne (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Ca, bool>::type
-maybe_ne (const Ca &a, const poly_int_pod<N, Cb> &b)
+maybe_ne (const Ca &a, const poly_int<N, Cb> &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
@@ -1324,7 +1237,7 @@ maybe_ne (const Ca &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline bool
-maybe_le (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+maybe_le (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
@@ -1335,7 +1248,7 @@ maybe_le (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Cb, bool>::type
-maybe_le (const poly_int_pod<N, Ca> &a, const Cb &b)
+maybe_le (const poly_int<N, Ca> &a, const Cb &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
@@ -1346,7 +1259,7 @@ maybe_le (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Ca, bool>::type
-maybe_le (const Ca &a, const poly_int_pod<N, Cb> &b)
+maybe_le (const Ca &a, const poly_int<N, Cb> &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
@@ -1366,7 +1279,7 @@ maybe_le (const Ca &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline bool
-maybe_lt (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+maybe_lt (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
@@ -1377,7 +1290,7 @@ maybe_lt (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Cb, bool>::type
-maybe_lt (const poly_int_pod<N, Ca> &a, const Cb &b)
+maybe_lt (const poly_int<N, Ca> &a, const Cb &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
@@ -1388,7 +1301,7 @@ maybe_lt (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Ca, bool>::type
-maybe_lt (const Ca &a, const poly_int_pod<N, Cb> &b)
+maybe_lt (const Ca &a, const poly_int<N, Cb> &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
@@ -1442,7 +1355,7 @@ ordered_p (const T1 &a, const T2 &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_POLY_RESULT (N, Ca, Cb)
-ordered_min (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+ordered_min (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   if (known_le (a, b))
     return a;
@@ -1456,7 +1369,7 @@ ordered_min (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline CONST_POLY_RESULT (N, Ca, Cb)
-ordered_min (const Ca &a, const poly_int_pod<N, Cb> &b)
+ordered_min (const Ca &a, const poly_int<N, Cb> &b)
 {
   if (known_le (a, b))
     return a;
@@ -1470,7 +1383,7 @@ ordered_min (const Ca &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_CONST_RESULT (N, Ca, Cb)
-ordered_min (const poly_int_pod<N, Ca> &a, const Cb &b)
+ordered_min (const poly_int<N, Ca> &a, const Cb &b)
 {
   if (known_le (a, b))
     return a;
@@ -1490,7 +1403,7 @@ ordered_min (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_POLY_RESULT (N, Ca, Cb)
-ordered_max (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+ordered_max (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   if (known_le (a, b))
     return b;
@@ -1504,7 +1417,7 @@ ordered_max (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline CONST_POLY_RESULT (N, Ca, Cb)
-ordered_max (const Ca &a, const poly_int_pod<N, Cb> &b)
+ordered_max (const Ca &a, const poly_int<N, Cb> &b)
 {
   if (known_le (a, b))
     return b;
@@ -1518,7 +1431,7 @@ ordered_max (const Ca &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_CONST_RESULT (N, Ca, Cb)
-ordered_max (const poly_int_pod<N, Ca> &a, const Cb &b)
+ordered_max (const poly_int<N, Ca> &a, const Cb &b)
 {
   if (known_le (a, b))
     return b;
@@ -1535,7 +1448,7 @@ ordered_max (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca>
 inline Ca
-constant_lower_bound (const poly_int_pod<N, Ca> &a)
+constant_lower_bound (const poly_int<N, Ca> &a)
 {
   gcc_checking_assert (known_ge (a, POLY_INT_TYPE (Ca) (0)));
   return a.coeffs[0];
@@ -1545,7 +1458,7 @@ constant_lower_bound (const poly_int_pod<N, Ca> &a)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_CONST_COEFF (Ca, Cb)
-constant_lower_bound_with_limit (const poly_int_pod<N, Ca> &a, const Cb &b)
+constant_lower_bound_with_limit (const poly_int<N, Ca> &a, const Cb &b)
 {
   if (known_ge (a, b))
     return a.coeffs[0];
@@ -1557,7 +1470,7 @@ constant_lower_bound_with_limit (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_CONST_COEFF (Ca, Cb)
-constant_upper_bound_with_limit (const poly_int_pod<N, Ca> &a, const Cb &b)
+constant_upper_bound_with_limit (const poly_int<N, Ca> &a, const Cb &b)
 {
   if (known_le (a, b))
     return a.coeffs[0];
@@ -1570,7 +1483,7 @@ constant_upper_bound_with_limit (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_CONST_RESULT (N, Ca, Cb)
-lower_bound (const poly_int_pod<N, Ca> &a, const Cb &b)
+lower_bound (const poly_int<N, Ca> &a, const Cb &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -1587,14 +1500,14 @@ lower_bound (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline CONST_POLY_RESULT (N, Ca, Cb)
-lower_bound (const Ca &a, const poly_int_pod<N, Cb> &b)
+lower_bound (const Ca &a, const poly_int<N, Cb> &b)
 {
   return lower_bound (b, a);
 }
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_POLY_RESULT (N, Ca, Cb)
-lower_bound (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+lower_bound (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -1619,7 +1532,7 @@ lower_bound (const Ca &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_CONST_RESULT (N, Ca, Cb)
-upper_bound (const poly_int_pod<N, Ca> &a, const Cb &b)
+upper_bound (const poly_int<N, Ca> &a, const Cb &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -1636,14 +1549,14 @@ upper_bound (const poly_int_pod<N, Ca> &a, const Cb &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline CONST_POLY_RESULT (N, Ca, Cb)
-upper_bound (const Ca &a, const poly_int_pod<N, Cb> &b)
+upper_bound (const Ca &a, const poly_int<N, Cb> &b)
 {
   return upper_bound (b, a);
 }
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_POLY_RESULT (N, Ca, Cb)
-upper_bound (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+upper_bound (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -1660,7 +1573,7 @@ upper_bound (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca>
 inline POLY_BINARY_COEFF (Ca, Ca)
-coeff_gcd (const poly_int_pod<N, Ca> &a)
+coeff_gcd (const poly_int<N, Ca> &a)
 {
   /* Find the first nonzero coefficient, stopping at 0 whatever happens.  */
   unsigned int i;
@@ -1681,7 +1594,7 @@ coeff_gcd (const poly_int_pod<N, Ca> &a)
 
 template<unsigned int N, typename Ca, typename Cb>
 POLY_CONST_RESULT (N, Ca, Cb)
-common_multiple (const poly_int_pod<N, Ca> &a, Cb b)
+common_multiple (const poly_int<N, Ca> &a, Cb b)
 {
   POLY_BINARY_COEFF (Ca, Ca) xgcd = coeff_gcd (a);
   return a * (least_common_multiple (xgcd, b) / xgcd);
@@ -1689,7 +1602,7 @@ common_multiple (const poly_int_pod<N, Ca> &a, Cb b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline CONST_POLY_RESULT (N, Ca, Cb)
-common_multiple (const Ca &a, const poly_int_pod<N, Cb> &b)
+common_multiple (const Ca &a, const poly_int<N, Cb> &b)
 {
   return common_multiple (b, a);
 }
@@ -1704,8 +1617,7 @@ common_multiple (const Ca &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 POLY_POLY_RESULT (N, Ca, Cb)
-force_common_multiple (const poly_int_pod<N, Ca> &a,
-                      const poly_int_pod<N, Cb> &b)
+force_common_multiple (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   if (b.is_constant ())
     return common_multiple (a, b.coeffs[0]);
@@ -1743,8 +1655,7 @@ force_common_multiple (const poly_int_pod<N, Ca> &a,
 
 template<unsigned int N, typename Ca, typename Cb>
 inline int
-compare_sizes_for_sort (const poly_int_pod<N, Ca> &a,
-                       const poly_int_pod<N, Cb> &b)
+compare_sizes_for_sort (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   for (unsigned int i = N; i-- > 0; )
     if (a.coeffs[i] != b.coeffs[i])
@@ -1756,7 +1667,7 @@ compare_sizes_for_sort (const poly_int_pod<N, Ca> &a,
 
 template<unsigned int N, typename Ca, typename Cb>
 inline bool
-can_align_p (const poly_int_pod<N, Ca> &value, Cb align)
+can_align_p (const poly_int<N, Ca> &value, Cb align)
 {
   for (unsigned int i = 1; i < N; i++)
     if ((value.coeffs[i] & (align - 1)) != 0)
@@ -1769,8 +1680,8 @@ can_align_p (const poly_int_pod<N, Ca> &value, Cb align)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline bool
-can_align_up (const poly_int_pod<N, Ca> &value, Cb align,
-             poly_int_pod<N, Ca> *aligned)
+can_align_up (const poly_int<N, Ca> &value, Cb align,
+             poly_int<N, Ca> *aligned)
 {
   if (!can_align_p (value, align))
     return false;
@@ -1783,8 +1694,8 @@ can_align_up (const poly_int_pod<N, Ca> &value, Cb align,
 
 template<unsigned int N, typename Ca, typename Cb>
 inline bool
-can_align_down (const poly_int_pod<N, Ca> &value, Cb align,
-               poly_int_pod<N, Ca> *aligned)
+can_align_down (const poly_int<N, Ca> &value, Cb align,
+               poly_int<N, Ca> *aligned)
 {
   if (!can_align_p (value, align))
     return false;
@@ -1798,8 +1709,8 @@ can_align_down (const poly_int_pod<N, Ca> &value, Cb align,
 
 template<unsigned int N, typename Ca, typename Cb, typename Cc>
 inline bool
-known_equal_after_align_up (const poly_int_pod<N, Ca> &a,
-                           const poly_int_pod<N, Cb> &b,
+known_equal_after_align_up (const poly_int<N, Ca> &a,
+                           const poly_int<N, Cb> &b,
                            Cc align)
 {
   poly_int<N, Ca> aligned_a;
@@ -1815,8 +1726,8 @@ known_equal_after_align_up (const poly_int_pod<N, Ca> &a,
 
 template<unsigned int N, typename Ca, typename Cb, typename Cc>
 inline bool
-known_equal_after_align_down (const poly_int_pod<N, Ca> &a,
-                             const poly_int_pod<N, Cb> &b,
+known_equal_after_align_down (const poly_int<N, Ca> &a,
+                             const poly_int<N, Cb> &b,
                              Cc align)
 {
   poly_int<N, Ca> aligned_a;
@@ -1835,7 +1746,7 @@ known_equal_after_align_down (const poly_int_pod<N, Ca> &a,
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, Ca>
-force_align_up (const poly_int_pod<N, Ca> &value, Cb align)
+force_align_up (const poly_int<N, Ca> &value, Cb align)
 {
   gcc_checking_assert (can_align_p (value, align));
   return value + (-value.coeffs[0] & (align - 1));
@@ -1850,7 +1761,7 @@ force_align_up (const poly_int_pod<N, Ca> &value, Cb align)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, Ca>
-force_align_down (const poly_int_pod<N, Ca> &value, Cb align)
+force_align_down (const poly_int<N, Ca> &value, Cb align)
 {
   gcc_checking_assert (can_align_p (value, align));
   return value - (value.coeffs[0] & (align - 1));
@@ -1862,7 +1773,7 @@ force_align_down (const poly_int_pod<N, Ca> &value, Cb align)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, Ca>
-aligned_lower_bound (const poly_int_pod<N, Ca> &value, Cb align)
+aligned_lower_bound (const poly_int<N, Ca> &value, Cb align)
 {
   poly_int<N, Ca> r;
   for (unsigned int i = 0; i < N; i++)
@@ -1879,7 +1790,7 @@ aligned_lower_bound (const poly_int_pod<N, Ca> &value, Cb align)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, Ca>
-aligned_upper_bound (const poly_int_pod<N, Ca> &value, Cb align)
+aligned_upper_bound (const poly_int<N, Ca> &value, Cb align)
 {
   poly_int<N, Ca> r;
   for (unsigned int i = 0; i < N; i++)
@@ -1898,7 +1809,7 @@ aligned_upper_bound (const poly_int_pod<N, Ca> &value, Cb align)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, Ca>
-force_align_down_and_div (const poly_int_pod<N, Ca> &value, Cb align)
+force_align_down_and_div (const poly_int<N, Ca> &value, Cb align)
 {
   gcc_checking_assert (can_align_p (value, align));
 
@@ -1922,7 +1833,7 @@ force_align_down_and_div (const poly_int_pod<N, Ca> &value, Cb align)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline poly_int<N, Ca>
-force_align_up_and_div (const poly_int_pod<N, Ca> &value, Cb align)
+force_align_up_and_div (const poly_int<N, Ca> &value, Cb align)
 {
   gcc_checking_assert (can_align_p (value, align));
 
@@ -1942,7 +1853,7 @@ force_align_up_and_div (const poly_int_pod<N, Ca> &value, Cb align)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cm>
 inline bool
-known_misalignment (const poly_int_pod<N, Ca> &value, Cb align, Cm *misalign)
+known_misalignment (const poly_int<N, Ca> &value, Cb align, Cm *misalign)
 {
   gcc_checking_assert (align != 0);
   if (!can_align_p (value, align))
@@ -1957,7 +1868,7 @@ known_misalignment (const poly_int_pod<N, Ca> &value, Cb align, Cm *misalign)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_BINARY_COEFF (Ca, Ca)
-force_get_misalignment (const poly_int_pod<N, Ca> &a, Cb align)
+force_get_misalignment (const poly_int<N, Ca> &a, Cb align)
 {
   gcc_checking_assert (can_align_p (a, align));
   return a.coeffs[0] & (align - 1);
@@ -1968,7 +1879,7 @@ force_get_misalignment (const poly_int_pod<N, Ca> &a, Cb align)
 
 template<unsigned int N, typename Ca>
 inline POLY_BINARY_COEFF (Ca, Ca)
-known_alignment (const poly_int_pod<N, Ca> &a)
+known_alignment (const poly_int<N, Ca> &a)
 {
   typedef POLY_BINARY_COEFF (Ca, Ca) C;
   C r = a.coeffs[0];
@@ -1982,7 +1893,7 @@ known_alignment (const poly_int_pod<N, Ca> &a)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cr>
 inline typename if_nonpoly<Cb, bool>::type
-can_ior_p (const poly_int_pod<N, Ca> &a, Cb b, Cr *result)
+can_ior_p (const poly_int<N, Ca> &a, Cb b, Cr *result)
 {
   /* Coefficients 1 and above must be a multiple of something greater
      than B.  */
@@ -2001,7 +1912,7 @@ can_ior_p (const poly_int_pod<N, Ca> &a, Cb b, Cr *result)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cm>
 inline typename if_nonpoly<Cb, bool>::type
-constant_multiple_p (const poly_int_pod<N, Ca> &a, Cb b, Cm *multiple)
+constant_multiple_p (const poly_int<N, Ca> &a, Cb b, Cm *multiple)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -2016,7 +1927,7 @@ constant_multiple_p (const poly_int_pod<N, Ca> &a, Cb b, Cm *multiple)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cm>
 inline typename if_nonpoly<Ca, bool>::type
-constant_multiple_p (Ca a, const poly_int_pod<N, Cb> &b, Cm *multiple)
+constant_multiple_p (Ca a, const poly_int<N, Cb> &b, Cm *multiple)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -2033,8 +1944,8 @@ constant_multiple_p (Ca a, const poly_int_pod<N, Cb> &b, Cm *multiple)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cm>
 inline bool
-constant_multiple_p (const poly_int_pod<N, Ca> &a,
-                    const poly_int_pod<N, Cb> &b, Cm *multiple)
+constant_multiple_p (const poly_int<N, Ca> &a,
+                    const poly_int<N, Cb> &b, Cm *multiple)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -2061,7 +1972,7 @@ constant_multiple_p (const poly_int_pod<N, Ca> &a,
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Cb, bool>::type
-constant_multiple_p (const poly_int_pod<N, Ca> &a, Cb b)
+constant_multiple_p (const poly_int<N, Ca> &a, Cb b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -2075,7 +1986,7 @@ constant_multiple_p (const poly_int_pod<N, Ca> &a, Cb b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Ca, bool>::type
-constant_multiple_p (Ca a, const poly_int_pod<N, Cb> &b)
+constant_multiple_p (Ca a, const poly_int<N, Cb> &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -2091,8 +2002,7 @@ constant_multiple_p (Ca a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline bool
-constant_multiple_p (const poly_int_pod<N, Ca> &a,
-                    const poly_int_pod<N, Cb> &b)
+constant_multiple_p (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -2127,7 +2037,7 @@ multiple_p (Ca a, Cb b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Cb, bool>::type
-multiple_p (const poly_int_pod<N, Ca> &a, Cb b)
+multiple_p (const poly_int<N, Ca> &a, Cb b)
 {
   for (unsigned int i = 0; i < N; ++i)
     if (a.coeffs[i] % b != 0)
@@ -2139,7 +2049,7 @@ multiple_p (const poly_int_pod<N, Ca> &a, Cb b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline typename if_nonpoly<Ca, bool>::type
-multiple_p (Ca a, const poly_int_pod<N, Cb> &b)
+multiple_p (Ca a, const poly_int<N, Cb> &b)
 {
   typedef POLY_INT_TYPE (Ca) int_type;
 
@@ -2153,7 +2063,7 @@ multiple_p (Ca a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline bool
-multiple_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+multiple_p (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   if (b.is_constant ())
     return multiple_p (a, b.coeffs[0]);
@@ -2179,7 +2089,7 @@ multiple_p (Ca a, Cb b, Cm *multiple)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cm>
 inline typename if_nonpoly<Cb, bool>::type
-multiple_p (const poly_int_pod<N, Ca> &a, Cb b, poly_int_pod<N, Cm> *multiple)
+multiple_p (const poly_int<N, Ca> &a, Cb b, poly_int<N, Cm> *multiple)
 {
   if (!multiple_p (a, b))
     return false;
@@ -2193,7 +2103,7 @@ multiple_p (const poly_int_pod<N, Ca> &a, Cb b, poly_int_pod<N, Cm> *multiple)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cm>
 inline typename if_nonpoly<Ca, bool>::type
-multiple_p (Ca a, const poly_int_pod<N, Cb> &b, Cm *multiple)
+multiple_p (Ca a, const poly_int<N, Cb> &b, Cm *multiple)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
 
@@ -2211,8 +2121,8 @@ multiple_p (Ca a, const poly_int_pod<N, Cb> &b, Cm *multiple)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cm>
 inline bool
-multiple_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b,
-           poly_int_pod<N, Cm> *multiple)
+multiple_p (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b,
+           poly_int<N, Cm> *multiple)
 {
   if (b.is_constant ())
     return multiple_p (a, b.coeffs[0], multiple);
@@ -2223,7 +2133,7 @@ multiple_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b,
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_CONST_RESULT (N, Ca, Cb)
-exact_div (const poly_int_pod<N, Ca> &a, Cb b)
+exact_div (const poly_int<N, Ca> &a, Cb b)
 {
   typedef POLY_CONST_COEFF (Ca, Cb) C;
   poly_int<N, C> r;
@@ -2239,7 +2149,7 @@ exact_div (const poly_int_pod<N, Ca> &a, Cb b)
 
 template<unsigned int N, typename Ca, typename Cb>
 inline POLY_POLY_RESULT (N, Ca, Cb)
-exact_div (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
+exact_div (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b)
 {
   if (b.is_constant ())
     return exact_div (a, b.coeffs[0]);
@@ -2270,7 +2180,7 @@ exact_div (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cq>
 inline typename if_nonpoly2<Cb, Cq, bool>::type
-can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b, Cq *quotient)
+can_div_trunc_p (const poly_int<N, Ca> &a, Cb b, Cq *quotient)
 {
   typedef POLY_CAST (Ca, Cb) NCa;
   typedef POLY_CAST (Cb, Ca) NCb;
@@ -2286,8 +2196,7 @@ can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b, Cq *quotient)
 
 template<unsigned int N, typename Ca, typename Cb, typename Cq>
 inline typename if_nonpoly<Cq, bool>::type
-can_div_trunc_p (const poly_int_pod<N, Ca> &a,
-                const poly_int_pod<N, Cb> &b,
+can_div_trunc_p (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b,
                 Cq *quotient)
 {
   /* We can calculate Q from the case in which the indeterminates
@@ -2397,8 +2306,7 @@ can_div_trunc_p (const poly_int_pod<N, Ca> &a,
 
 template<unsigned int N, typename Ca, typename Cb, typename Cq, typename Cr>
 inline typename if_nonpoly<Cq, bool>::type
-can_div_trunc_p (const poly_int_pod<N, Ca> &a,
-                const poly_int_pod<N, Cb> &b,
+can_div_trunc_p (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b,
                 Cq *quotient, Cr *remainder)
 {
   if (!can_div_trunc_p (a, b, quotient))
@@ -2417,8 +2325,8 @@ can_div_trunc_p (const poly_int_pod<N, Ca> &a,
 
 template<unsigned int N, typename Ca, typename Cb, typename Cq>
 inline typename if_nonpoly<Cb, bool>::type
-can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b,
-                poly_int_pod<N, Cq> *quotient)
+can_div_trunc_p (const poly_int<N, Ca> &a, Cb b,
+                poly_int<N, Cq> *quotient)
 {
   /* The remainder must be constant.  */
   for (unsigned int i = 1; i < N; ++i)
@@ -2433,8 +2341,8 @@ can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b,
 
 template<unsigned int N, typename Ca, typename Cb, typename Cq, typename Cr>
 inline typename if_nonpoly<Cb, bool>::type
-can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b,
-                poly_int_pod<N, Cq> *quotient, Cr *remainder)
+can_div_trunc_p (const poly_int<N, Ca> &a, Cb b,
+                poly_int<N, Cq> *quotient, Cr *remainder)
 {
   if (!can_div_trunc_p (a, b, quotient))
     return false;
@@ -2450,9 +2358,8 @@ can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b,
 
 template<unsigned int N, typename Ca, typename Cb, typename Cq>
 inline bool
-can_div_trunc_p (const poly_int_pod<N, Ca> &a,
-                const poly_int_pod<N, Cb> &b,
-                poly_int_pod<N, Cq> *quotient)
+can_div_trunc_p (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b,
+                poly_int<N, Cq> *quotient)
 {
   if (b.is_constant ())
     return can_div_trunc_p (a, b.coeffs[0], quotient);
@@ -2473,8 +2380,7 @@ can_div_trunc_p (const poly_int_pod<N, Ca> &a,
 
 template<unsigned int N, typename Ca, typename Cb, typename Cq>
 inline typename if_nonpoly<Cq, bool>::type
-can_div_away_from_zero_p (const poly_int_pod<N, Ca> &a,
-                         const poly_int_pod<N, Cb> &b,
+can_div_away_from_zero_p (const poly_int<N, Ca> &a, const poly_int<N, Cb> &b,
                          Cq *quotient)
 {
   if (!can_div_trunc_p (a, b, quotient))
@@ -2489,7 +2395,7 @@ can_div_away_from_zero_p (const poly_int_pod<N, Ca> &a,
 
 template<unsigned int N, typename C>
 void
-print_dec (const poly_int_pod<N, C> &value, FILE *file, signop sgn)
+print_dec (const poly_int<N, C> &value, FILE *file, signop sgn)
 {
   if (value.is_constant ())
     print_dec (value.coeffs[0], file, sgn);
@@ -2509,7 +2415,7 @@ print_dec (const poly_int_pod<N, C> &value, FILE *file, signop sgn)
 
 template<unsigned int N, typename C>
 void
-print_dec (const poly_int_pod<N, C> &value, FILE *file)
+print_dec (const poly_int<N, C> &value, FILE *file)
 {
   STATIC_ASSERT (poly_coeff_traits<C>::signedness >= 0);
   print_dec (value, file,
@@ -2520,7 +2426,7 @@ print_dec (const poly_int_pod<N, C> &value, FILE *file)
 
 template<unsigned int N, typename C>
 void
-print_hex (const poly_int_pod<N, C> &value, FILE *file)
+print_hex (const poly_int<N, C> &value, FILE *file)
 {
   if (value.is_constant ())
     print_hex (value.coeffs[0], file);
@@ -2570,7 +2476,7 @@ struct poly_span_traits<T1, T2, unsigned HOST_WIDE_INT>
 
   template<unsigned int N, typename T>
   static poly_int<N, unsigned HOST_WIDE_INT>
-  cast (const poly_int_pod<N, T> &x) { return x; }
+  cast (const poly_int<N, T> &x) { return x; }
 };
 
 /* Return true if SIZE represents a known size, assuming that all-ones
@@ -2709,8 +2615,8 @@ endpoint_representable_p (const T &pos, const T &size)
 
 template<unsigned int N, typename C>
 inline bool
-endpoint_representable_p (const poly_int_pod<N, C> &pos,
-                         const poly_int_pod<N, C> &size)
+endpoint_representable_p (const poly_int<N, C> &pos,
+                         const poly_int<N, C> &size)
 {
   if (known_size_p (size))
     for (unsigned int i = 0; i < N; ++i)
@@ -2721,19 +2627,19 @@ endpoint_representable_p (const poly_int_pod<N, C> &pos,
 
 template<unsigned int N, typename C>
 void
-gt_ggc_mx (poly_int_pod<N, C> *)
+gt_ggc_mx (poly_int<N, C> *)
 {
 }
 
 template<unsigned int N, typename C>
 void
-gt_pch_nx (poly_int_pod<N, C> *)
+gt_pch_nx (poly_int<N, C> *)
 {
 }
 
 template<unsigned int N, typename C>
 void
-gt_pch_nx (poly_int_pod<N, C> *, gt_pointer_operator, void *)
+gt_pch_nx (poly_int<N, C> *, gt_pointer_operator, void *)
 {
 }
 
index 3d789a238121f489387d188319bed5281a57b320..ee01d895d61207b1da78f581655b3b84857b25cf 100644 (file)
@@ -811,7 +811,7 @@ pp_clear_state (pretty_printer *pp)
 /* Print X to PP in decimal.  */
 template<unsigned int N, typename T>
 void
-pp_wide_integer (pretty_printer *pp, const poly_int_pod<N, T> &x)
+pp_wide_integer (pretty_printer *pp, const poly_int<N, T> &x)
 {
   if (x.is_constant ())
     pp_wide_integer (pp, x.coeffs[0]);
@@ -828,9 +828,9 @@ pp_wide_integer (pretty_printer *pp, const poly_int_pod<N, T> &x)
     }
 }
 
-template void pp_wide_integer (pretty_printer *, const poly_uint16_pod &);
-template void pp_wide_integer (pretty_printer *, const poly_int64_pod &);
-template void pp_wide_integer (pretty_printer *, const poly_uint64_pod &);
+template void pp_wide_integer (pretty_printer *, const poly_uint16 &);
+template void pp_wide_integer (pretty_printer *, const poly_int64 &);
+template void pp_wide_integer (pretty_printer *, const poly_uint64 &);
 
 /* Flush the formatted text of PRETTY-PRINTER onto the attached stream.  */
 void
index 0d9bc991a5ad936bbcb1a6ca48af9be0032562ec..8ba4296578baff0c4944118fb0873695642b6d1c 100644 (file)
@@ -445,6 +445,6 @@ pp_wide_int (pretty_printer *pp, const wide_int_ref &w, signop sgn)
 }
 
 template<unsigned int N, typename T>
-void pp_wide_integer (pretty_printer *pp, const poly_int_pod<N, T> &);
+void pp_wide_integer (pretty_printer *pp, const poly_int<N, T> &);
 
 #endif /* GCC_PRETTY_PRINT_H */
index 2126bdd117c8db1e4f9781c114bc3df5066b127d..e0024792d4c2dd86c700e62fe7fa8f0075f2adf3 100644 (file)
@@ -168,8 +168,8 @@ struct decomposition
   int reg_flag;                /* Nonzero if referencing a register.  */
   int safe;            /* Nonzero if this can't conflict with anything.  */
   rtx base;            /* Base address for MEM.  */
-  poly_int64_pod start;        /* Starting offset or register number.  */
-  poly_int64_pod end;  /* Ending offset or register number.  */
+  poly_int64 start;    /* Starting offset or register number.  */
+  poly_int64 end;      /* Ending offset or register number.  */
 };
 
 /* Save MEMs needed to copy from one class of registers to another.  One MEM
index 0982d0c5d51dcd0a6c25acb2ce732eb4041e048f..9e8c060088d2d19b85d9c94a2723dbca3b3e6e3f 100644 (file)
@@ -97,7 +97,7 @@ struct reload
   /* Positive amount to increment or decrement by if
      reload_in is a PRE_DEC, PRE_INC, POST_DEC, POST_INC.
      Ignored otherwise (don't assume it is zero).  */
-  poly_int64_pod inc;
+  poly_int64 inc;
   /* A reg for which reload_in is the equivalent.
      If reload_in is a symbol_ref which came from
      reg_equiv_constant, then this is the pseudo
index 9ba822d1ff7cf3fc339a2870e646c486cd0a2198..55a416d79ce7f9e674a9309c002d25a7309590f0 100644 (file)
@@ -196,7 +196,7 @@ static int last_spill_reg;
 static rtx spill_stack_slot[FIRST_PSEUDO_REGISTER];
 
 /* Width allocated so far for that stack slot.  */
-static poly_uint64_pod spill_stack_slot_width[FIRST_PSEUDO_REGISTER];
+static poly_uint64 spill_stack_slot_width[FIRST_PSEUDO_REGISTER];
 
 /* Record which pseudos needed to be spilled.  */
 static regset_head spilled_pseudos;
@@ -257,13 +257,13 @@ struct elim_table
 {
   int from;                    /* Register number to be eliminated.  */
   int to;                      /* Register number used as replacement.  */
-  poly_int64_pod initial_offset; /* Initial difference between values.  */
+  poly_int64 initial_offset; /* Initial difference between values.  */
   int can_eliminate;           /* Nonzero if this elimination can be done.  */
   int can_eliminate_previous;  /* Value returned by TARGET_CAN_ELIMINATE
                                   target hook in previous scan over insns
                                   made by reload.  */
-  poly_int64_pod offset;       /* Current offset between the two regs.  */
-  poly_int64_pod previous_offset; /* Offset at end of previous insn.  */
+  poly_int64 offset;           /* Current offset between the two regs.  */
+  poly_int64 previous_offset;  /* Offset at end of previous insn.  */
   int ref_outside_mem;         /* "to" has been referenced outside a MEM.  */
   rtx from_rtx;                        /* REG rtx for the register to be eliminated.
                                   We cannot simply compare the number since
@@ -309,7 +309,7 @@ static int num_eliminable_invariants;
 
 static int first_label_num;
 static char *offsets_known_at;
-static poly_int64_pod (*offsets_at)[NUM_ELIMINABLE_REGS];
+static poly_int64 (*offsets_at)[NUM_ELIMINABLE_REGS];
 
 vec<reg_equivs_t, va_gc> *reg_equivs;
 
@@ -4020,7 +4020,7 @@ init_eliminable_invariants (rtx_insn *first, bool do_subregs)
 
   /* Allocate the tables used to store offset information at labels.  */
   offsets_known_at = XNEWVEC (char, num_labels);
-  offsets_at = (poly_int64_pod (*)[NUM_ELIMINABLE_REGS])
+  offsets_at = (poly_int64 (*)[NUM_ELIMINABLE_REGS])
     xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (poly_int64));
 
 /* Look for REG_EQUIV notes; record what each pseudo is equivalent
index 8e59cd5d156c98b8118fa1a55bd706ff05858756..6850281af62a5d0ccfcc1f6b02d454998fbac571 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -204,7 +204,7 @@ union rtunion
 {
   int rt_int;
   unsigned int rt_uint;
-  poly_uint16_pod rt_subreg;
+  poly_uint16 rt_subreg;
   const char *rt_str;
   rtx rt_rtx;
   rtvec rt_rtvec;
@@ -2402,7 +2402,7 @@ rtx_to_poly_int64 (const_rtx x)
    otherwise leave it unmodified.  */
 
 inline bool
-poly_int_rtx_p (const_rtx x, poly_int64_pod *res)
+poly_int_rtx_p (const_rtx x, poly_int64 *res)
 {
   if (CONST_INT_P (x))
     {
@@ -3630,7 +3630,7 @@ extern HOST_WIDE_INT get_integer_term (const_rtx);
 extern rtx get_related_value (const_rtx);
 extern bool offset_within_block_p (const_rtx, HOST_WIDE_INT);
 extern void split_const (rtx, rtx *, rtx *);
-extern rtx strip_offset (rtx, poly_int64_pod *);
+extern rtx strip_offset (rtx, poly_int64 *);
 extern poly_int64 get_args_size (const_rtx);
 extern bool unsigned_reg_p (rtx);
 extern bool reg_mentioned_p (const_rtx, const_rtx);
@@ -4586,7 +4586,7 @@ load_extend_op (machine_mode mode)
    and return the base.  Return X otherwise.  */
 
 inline rtx
-strip_offset_and_add (rtx x, poly_int64_pod *offset)
+strip_offset_and_add (rtx x, poly_int64 *offset)
 {
   if (GET_CODE (x) == PLUS)
     {
index 8b48fc243a115788b2242f2c7ecb74a4cf43d642..87267ee3b886175e888e0e079d46d7a9d6835061 100644 (file)
@@ -945,7 +945,7 @@ split_const (rtx x, rtx *base_out, rtx *offset_out)
    to a new rtx).  Return the Y and store the offset in *OFFSET_OUT.  */
 
 rtx
-strip_offset (rtx x, poly_int64_pod *offset_out)
+strip_offset (rtx x, poly_int64 *offset_out)
 {
   rtx base = const0_rtx;
   rtx test = x;
index 7af98595a5e52b1d74843b059216d2039fb88528..022ccd69cea545d826bebff7cbe079d1e78ac833 100644 (file)
@@ -4839,11 +4839,11 @@ test_num_coeffs_extra ()
 {
   /* Test the most common POD types.  */
   test_unsigned<N, unsigned short, HOST_WIDE_INT,
-               poly_int_pod<N, unsigned short> > ();
+               poly_int<N, unsigned short> > ();
   test_signed<N, HOST_WIDE_INT, HOST_WIDE_INT,
-             poly_int_pod<N, HOST_WIDE_INT> > ();
+             poly_int<N, HOST_WIDE_INT> > ();
   test_unsigned<N, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT,
-               poly_int_pod<N, unsigned HOST_WIDE_INT> > ();
+               poly_int<N, unsigned HOST_WIDE_INT> > ();
 
   /* Test some coefficient types that weren't covered in the core tests.  */
   test_signed<N, int, HOST_WIDE_INT,
index ad8cfedec8ce884626a884ef96394d761a2c5bd4..af8e9243947e2b6fe1209825c60c28b06b11d759 100644 (file)
@@ -372,9 +372,9 @@ get_or_create_ssa_default_def (struct function *fn, tree var)
    true, the storage order of the reference is reversed.  */
 
 tree
-get_ref_base_and_extent (tree exp, poly_int64_pod *poffset,
-                        poly_int64_pod *psize,
-                        poly_int64_pod *pmax_size,
+get_ref_base_and_extent (tree exp, poly_int64 *poffset,
+                        poly_int64 *psize,
+                        poly_int64 *pmax_size,
                         bool *preverse)
 {
   poly_offset_int bitsize = -1;
@@ -765,7 +765,7 @@ get_ref_base_and_extent_hwi (tree exp, HOST_WIDE_INT *poffset,
    its argument or a constant if the argument is known to be constant.  */
 
 tree
-get_addr_base_and_unit_offset_1 (tree exp, poly_int64_pod *poffset,
+get_addr_base_and_unit_offset_1 (tree exp, poly_int64 *poffset,
                                 tree (*valueize) (tree))
 {
   poly_int64 byte_offset = 0;
@@ -907,7 +907,7 @@ done:
    is not BITS_PER_UNIT-aligned.  */
 
 tree
-get_addr_base_and_unit_offset (tree exp, poly_int64_pod *poffset)
+get_addr_base_and_unit_offset (tree exp, poly_int64 *poffset)
 {
   return get_addr_base_and_unit_offset_1 (exp, poffset, NULL);
 }
index 074a4da3a6cdd651a9daeff88005ba3f34368e3d..e27baa8aa17d8286d2fe74445372c03ca05e26ce 100644 (file)
@@ -30,13 +30,13 @@ extern void debug_dfa_stats (void);
 extern tree ssa_default_def (struct function *, tree);
 extern void set_ssa_default_def (struct function *, tree, tree);
 extern tree get_or_create_ssa_default_def (struct function *, tree);
-extern tree get_ref_base_and_extent (tree, poly_int64_pod *, poly_int64_pod *,
-                                    poly_int64_pod *, bool *);
+extern tree get_ref_base_and_extent (tree, poly_int64 *, poly_int64 *,
+                                    poly_int64 *, bool *);
 extern tree get_ref_base_and_extent_hwi (tree, HOST_WIDE_INT *,
                                         HOST_WIDE_INT *, bool *);
-extern tree get_addr_base_and_unit_offset_1 (tree, poly_int64_pod *,
+extern tree get_addr_base_and_unit_offset_1 (tree, poly_int64 *,
                                             tree (*) (tree));
-extern tree get_addr_base_and_unit_offset (tree, poly_int64_pod *);
+extern tree get_addr_base_and_unit_offset (tree, poly_int64 *);
 extern bool stmt_references_abnormal_ssa_name (gimple *);
 extern void replace_abnormal_ssa_names (gimple *);
 extern void dump_enumerated_decls (FILE *, dump_flags_t);
index 3d3f28f7f3ba1b6a06eb8342a77d89781a7dff11..339f37d8720e7cea3e30161ccb774ebab55bd992 100644 (file)
@@ -412,7 +412,7 @@ struct iv_use
   tree *op_p;          /* The place where it occurs.  */
 
   tree addr_base;      /* Base address with const offset stripped.  */
-  poly_uint64_pod addr_offset;
+  poly_uint64 addr_offset;
                        /* Const offset stripped from base address.  */
 };
 
@@ -2956,7 +2956,7 @@ strip_offset_1 (tree expr, bool inside_addr, bool top_compref,
 /* Strips constant offsets from EXPR and stores them to OFFSET.  */
 
 static tree
-strip_offset (tree expr, poly_uint64_pod *offset)
+strip_offset (tree expr, poly_uint64 *offset)
 {
   poly_int64 off;
   tree core = strip_offset_1 (expr, false, false, &off);
index 675240ebb9d369eeaed33108119c0e1c90bb8d53..98d70e0ffe0703603790b19e00a9bdf10f87f3de 100644 (file)
@@ -114,7 +114,7 @@ typedef struct vn_reference_op_struct
   /* For storing TYPE_ALIGN for array ref element size computation.  */
   unsigned align : 6;
   /* Constant offset this op adds or -1 if it is variable.  */
-  poly_int64_pod off;
+  poly_int64 off;
   tree type;
   tree op0;
   tree op1;
index 8a8d6d5091a403c0888e81f9c16204643b3c9a19..54ca5e750df645252fe9aebf4313d4a6c253e541 100644 (file)
@@ -3289,7 +3289,7 @@ really_constant_p (const_tree exp)
    like sizetype is used to encode a value that is actually negative.  */
 
 bool
-ptrdiff_tree_p (const_tree t, poly_int64_pod *value)
+ptrdiff_tree_p (const_tree t, poly_int64 *value)
 {
   if (!t)
     return false;
index 54cf8282cb2a5666ee30b06e070a4f2d67577fe5..005c157e9b07cd9d82aff62ae825e2b370b035c8 100644 (file)
@@ -4974,7 +4974,7 @@ extern tree max_object_size ();
    without loss of precision.  Store the value in *VALUE if so.  */
 
 inline bool
-poly_int_tree_p (const_tree t, poly_int64_pod *value)
+poly_int_tree_p (const_tree t, poly_int64 *value)
 {
   if (tree_fits_poly_int64_p (t))
     {
@@ -4988,7 +4988,7 @@ poly_int_tree_p (const_tree t, poly_int64_pod *value)
    without loss of precision.  Store the value in *VALUE if so.  */
 
 inline bool
-poly_int_tree_p (const_tree t, poly_uint64_pod *value)
+poly_int_tree_p (const_tree t, poly_uint64 *value)
 {
   if (tree_fits_poly_uint64_p (t))
     {
@@ -5617,7 +5617,7 @@ bit_field_offset (const_tree t)
 
 extern tree strip_float_extensions (tree);
 extern bool really_constant_p (const_tree);
-extern bool ptrdiff_tree_p (const_tree, poly_int64_pod *);
+extern bool ptrdiff_tree_p (const_tree, poly_int64 *);
 extern bool decl_address_invariant_p (const_tree);
 extern bool decl_address_ip_invariant_p (const_tree);
 extern bool int_fits_type_p (const_tree, const_tree)
@@ -6637,7 +6637,7 @@ extern bool complete_ctor_at_level_p (const_tree, HOST_WIDE_INT, const_tree);
 /* Given an expression EXP that is a handled_component_p,
    look for the ultimate containing object, which is returned and specify
    the access position and size.  */
-extern tree get_inner_reference (tree, poly_int64_pod *, poly_int64_pod *,
+extern tree get_inner_reference (tree, poly_int64 *, poly_int64 *,
                                 tree *, machine_mode *, int *, int *, int *);
 
 extern tree build_personality_function (const char *);