to take ptr_extend into account as third type of extension.
(SUBREG_PROMOTED_UNSIGNED_SET): Definition of new macro to set bit
fields used by SUBREG_PROMOTED_UNSIGNED_P.
* rtl.h (SUBREG_PROMOTED_UNSIGNED_SET): New macro.
(SUBREG_PROMOTED_UNSIGNED_P): Change to return -1 as well as 0 or 1.
* calls.c (precompute_arguments): Use new macro.
(expand_call): Ditto.
* combine.c (nonzero_bits): Ditto.
(record_promoted_value): Ditto.
* expr.c (store_expr): Ditto.
(expand_expr): Ditto.
* function.c (assign_parms): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50174
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-02-28 Steve Ellcey <sje@cup.hp.com>
+
+ * doc/rtl.texi (SUBREG_PROMOTED_UNSIGNED_P): Change definition
+ to take ptr_extend into account as third type of extension.
+ (SUBREG_PROMOTED_UNSIGNED_SET): Definition of new macro to set bit
+ fields used by SUBREG_PROMOTED_UNSIGNED_P.
+ * rtl.h (SUBREG_PROMOTED_UNSIGNED_SET): New macro.
+ (SUBREG_PROMOTED_UNSIGNED_P): Change to return -1 as well as 0 or 1.
+ * calls.c (precompute_arguments): Use new macro.
+ (expand_call): Ditto.
+ * combine.c (nonzero_bits): Ditto.
+ (record_promoted_value): Ditto.
+ * expr.c (store_expr): Ditto.
+ (expand_expr): Ditto.
+ * function.c (assign_parms): Ditto.
+
2002-02-28 Alexandre Oliva <aoliva@redhat.com>
* gcc.c (init_gcc_specs): Get -static and -static-libgcc to
args[i].initial_value
= gen_lowpart_SUBREG (mode, args[i].value);
SUBREG_PROMOTED_VAR_P (args[i].initial_value) = 1;
- SUBREG_PROMOTED_UNSIGNED_P (args[i].initial_value)
- = args[i].unsignedp;
+ SUBREG_PROMOTED_UNSIGNED_SET (args[i].initial_value,
+ args[i].unsignedp);
}
#endif
}
}
target = gen_rtx_SUBREG (TYPE_MODE (type), target, offset);
SUBREG_PROMOTED_VAR_P (target) = 1;
- SUBREG_PROMOTED_UNSIGNED_P (target) = unsignedp;
+ SUBREG_PROMOTED_UNSIGNED_SET (target, unsignedp);
}
#endif
been zero-extended, we know that at least the high-order bits
are zero, though others might be too. */
- if (SUBREG_PROMOTED_VAR_P (x) && SUBREG_PROMOTED_UNSIGNED_P (x))
+ if (SUBREG_PROMOTED_VAR_P (x) && SUBREG_PROMOTED_UNSIGNED_P (x) > 0)
nonzero = (GET_MODE_MASK (GET_MODE (x))
& nonzero_bits (SUBREG_REG (x), GET_MODE (x)));
if (reg_last_set[regno] == insn)
{
- if (SUBREG_PROMOTED_UNSIGNED_P (subreg))
+ if (SUBREG_PROMOTED_UNSIGNED_P (subreg) > 0)
reg_last_set_nonzero_bits[regno] &= GET_MODE_MASK (mode);
}
Stored in the @code{frame_related} field and printed as @samp{/f}.
@findex SUBREG_PROMOTED_UNSIGNED_P
-@cindex @code{subreg} and @samp{/u}
+@cindex @code{subreg} and @samp{/u} and @samp{/v}
@cindex @code{unchanging}, in @code{subreg}
+@cindex @code{volatil}, in @code{subreg}
@item SUBREG_PROMOTED_UNSIGNED_P (@var{x})
-Nonzero in a @code{subreg} that has @code{SUBREG_PROMOTED_VAR_P} nonzero
-if the object being referenced is kept zero-extended and zero if it
-is kept sign-extended. Stored in the @code{unchanging} field and
-printed as @samp{/u}.
+Returns a value greater then zero for a @code{subreg} that has
+@code{SUBREG_PROMOTED_VAR_P} nonzero if the object being referenced is kept
+zero-extended, zero if it is kept sign-extended, and less then zero if it is
+extended some other way via the @code{ptr_extend} instruction.
+Stored in the @code{unchanging}
+field and @code{volatil} field, printed as @samp{/u} and @samp{/v}.
+This macro may only be used to get the value it may not be used to change
+the value. Use @code{SUBREG_PROMOTED_UNSIGNED_SET} to change the value.
+
+@findex SUBREG_PROMOTED_UNSIGNED_SET
+@cindex @code{subreg} and @samp{/u}
+@cindex @code{unchanging}, in @code{subreg}
+@cindex @code{volatil}, in @code{subreg}
+@item SUBREG_PROMOTED_UNSIGNED_SET (@var{x})
+Set the @code{unchanging} and @code{volatil} fields in a @code{subreg}
+to reflect zero, sign, or other extension. If @code{volatil} is
+zero, then @code{unchanging} as nonzero means zero extension and as
+zero means sign extension. If @code{volatil} is nonzero then some
+other type of extension was done via the @code{ptr_extend} instruction.
@findex SUBREG_PROMOTED_VAR_P
@cindex @code{subreg} and @samp{/s}
{
temp = gen_lowpart_SUBREG (GET_MODE (target), temp);
SUBREG_PROMOTED_VAR_P (temp) = 1;
- SUBREG_PROMOTED_UNSIGNED_P (temp)
- = SUBREG_PROMOTED_UNSIGNED_P (target);
+ SUBREG_PROMOTED_UNSIGNED_SET (temp,
+ SUBREG_PROMOTED_UNSIGNED_P (target));
}
else
temp = convert_modes (GET_MODE (target),
temp = gen_lowpart_SUBREG (mode, DECL_RTL (exp));
SUBREG_PROMOTED_VAR_P (temp) = 1;
- SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp;
+ SUBREG_PROMOTED_UNSIGNED_SET (temp, unsignedp);
return temp;
}
{
temp = gen_lowpart_SUBREG (mode, SAVE_EXPR_RTL (exp));
SUBREG_PROMOTED_VAR_P (temp) = 1;
- SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp;
+ SUBREG_PROMOTED_UNSIGNED_SET (temp, unsignedp);
}
if (temp == const0_rtx)
promote_mode (type, mode, &unsignedp, 0);
temp = gen_lowpart_SUBREG (mode, SAVE_EXPR_RTL (exp));
SUBREG_PROMOTED_VAR_P (temp) = 1;
- SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp;
+ SUBREG_PROMOTED_UNSIGNED_SET (temp, unsignedp);
return temp;
}
/* The argument is already sign/zero extended, so note it
into the subreg. */
SUBREG_PROMOTED_VAR_P (tempreg) = 1;
- SUBREG_PROMOTED_UNSIGNED_P (tempreg) = unsignedp;
+ SUBREG_PROMOTED_UNSIGNED_SET (tempreg, unsignedp);
}
/* TREE_USED gets set erroneously during expand_assignment. */
when assigning to SUBREG_REG. */
#define SUBREG_PROMOTED_VAR_P(RTX) ((RTX)->in_struct)
-#define SUBREG_PROMOTED_UNSIGNED_P(RTX) ((RTX)->unchanging)
+#define SUBREG_PROMOTED_UNSIGNED_SET(RTX, VAL) \
+do { \
+ if ((VAL) < 0) \
+ (RTX)->volatil = 1; \
+ else { \
+ (RTX)->volatil = 0; \
+ (RTX)->unchanging = (VAL); \
+ } \
+} while (0)
+#define SUBREG_PROMOTED_UNSIGNED_P(RTX) ((RTX)->volatil ? -1 : (RTX)->unchanging)
/* Access various components of an ASM_OPERANDS rtx. */