+/* Create or reuse a fract type by SIZE, UNSIGNEDP, and SATP. */
+
+static tree
+make_or_reuse_fract_type (unsigned size, int unsignedp, int satp)
+{
+ if (satp)
+ {
+ if (size == SHORT_FRACT_TYPE_SIZE)
+ return unsignedp ? sat_unsigned_short_fract_type_node
+ : sat_short_fract_type_node;
+ if (size == FRACT_TYPE_SIZE)
+ return unsignedp ? sat_unsigned_fract_type_node : sat_fract_type_node;
+ if (size == LONG_FRACT_TYPE_SIZE)
+ return unsignedp ? sat_unsigned_long_fract_type_node
+ : sat_long_fract_type_node;
+ if (size == LONG_LONG_FRACT_TYPE_SIZE)
+ return unsignedp ? sat_unsigned_long_long_fract_type_node
+ : sat_long_long_fract_type_node;
+ }
+ else
+ {
+ if (size == SHORT_FRACT_TYPE_SIZE)
+ return unsignedp ? unsigned_short_fract_type_node
+ : short_fract_type_node;
+ if (size == FRACT_TYPE_SIZE)
+ return unsignedp ? unsigned_fract_type_node : fract_type_node;
+ if (size == LONG_FRACT_TYPE_SIZE)
+ return unsignedp ? unsigned_long_fract_type_node
+ : long_fract_type_node;
+ if (size == LONG_LONG_FRACT_TYPE_SIZE)
+ return unsignedp ? unsigned_long_long_fract_type_node
+ : long_long_fract_type_node;
+ }
+
+ return make_fract_type (size, unsignedp, satp);
+}
+
+/* Create or reuse an accum type by SIZE, UNSIGNEDP, and SATP. */
+
+static tree
+make_or_reuse_accum_type (unsigned size, int unsignedp, int satp)
+{
+ if (satp)
+ {
+ if (size == SHORT_ACCUM_TYPE_SIZE)
+ return unsignedp ? sat_unsigned_short_accum_type_node
+ : sat_short_accum_type_node;
+ if (size == ACCUM_TYPE_SIZE)
+ return unsignedp ? sat_unsigned_accum_type_node : sat_accum_type_node;
+ if (size == LONG_ACCUM_TYPE_SIZE)
+ return unsignedp ? sat_unsigned_long_accum_type_node
+ : sat_long_accum_type_node;
+ if (size == LONG_LONG_ACCUM_TYPE_SIZE)
+ return unsignedp ? sat_unsigned_long_long_accum_type_node
+ : sat_long_long_accum_type_node;
+ }
+ else
+ {
+ if (size == SHORT_ACCUM_TYPE_SIZE)
+ return unsignedp ? unsigned_short_accum_type_node
+ : short_accum_type_node;
+ if (size == ACCUM_TYPE_SIZE)
+ return unsignedp ? unsigned_accum_type_node : accum_type_node;
+ if (size == LONG_ACCUM_TYPE_SIZE)
+ return unsignedp ? unsigned_long_accum_type_node
+ : long_accum_type_node;
+ if (size == LONG_LONG_ACCUM_TYPE_SIZE)
+ return unsignedp ? unsigned_long_long_accum_type_node
+ : long_long_accum_type_node;
+ }
+
+ return make_accum_type (size, unsignedp, satp);
+}
+