diff options
author | Steve Ellcey <sje@cup.hp.com> | 2002-03-01 01:19:52 +0000 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-02-28 17:19:52 -0800 |
commit | 7879b81e6cedc9090e72804014ab1927832fe8e0 (patch) | |
tree | 7b548c0ab1fb1a218191d2b6c99b0f25d0d7bf12 /gcc | |
parent | 42d579d8796eca2c8c184c52194ea8659d59c20b (diff) | |
download | gcc-7879b81e6cedc9090e72804014ab1927832fe8e0.zip gcc-7879b81e6cedc9090e72804014ab1927832fe8e0.tar.gz gcc-7879b81e6cedc9090e72804014ab1927832fe8e0.tar.bz2 |
rtl.texi (SUBREG_PROMOTED_UNSIGNED_P): Change definition to take ptr_extend into account as third type of extension.
* 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.
From-SVN: r50174
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/calls.c | 6 | ||||
-rw-r--r-- | gcc/combine.c | 4 | ||||
-rw-r--r-- | gcc/doc/rtl.texi | 26 | ||||
-rw-r--r-- | gcc/expr.c | 10 | ||||
-rw-r--r-- | gcc/function.c | 2 | ||||
-rw-r--r-- | gcc/rtl.h | 11 |
7 files changed, 58 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 77693f3..5aa2209 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +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 diff --git a/gcc/calls.c b/gcc/calls.c index 7e2bc4b..bbcc108 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1542,8 +1542,8 @@ precompute_arguments (flags, num_actuals, args) 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 } @@ -3279,7 +3279,7 @@ expand_call (exp, target, ignore) } 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 diff --git a/gcc/combine.c b/gcc/combine.c index dba7997..733ce27 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -8270,7 +8270,7 @@ nonzero_bits (x, mode) 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))); @@ -11325,7 +11325,7 @@ record_promoted_value (insn, subreg) 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); } diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi index 2151047..58faea9 100644 --- a/gcc/doc/rtl.texi +++ b/gcc/doc/rtl.texi @@ -631,13 +631,29 @@ string constant pool. 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} @@ -4049,8 +4049,8 @@ store_expr (exp, target, want_value) { 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), @@ -6289,7 +6289,7 @@ expand_expr (exp, target, tmode, modifier) 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; } @@ -6409,7 +6409,7 @@ expand_expr (exp, target, tmode, modifier) { 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) @@ -6431,7 +6431,7 @@ expand_expr (exp, target, tmode, modifier) 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; } diff --git a/gcc/function.c b/gcc/function.c index 0c2298c..0d708ca 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4733,7 +4733,7 @@ assign_parms (fndecl) /* 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. */ @@ -853,7 +853,16 @@ extern unsigned int subreg_regno PARAMS ((rtx)); 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. */ |