summaryrefslogtreecommitdiff
path: root/gcc/df-scan.c
diff options
context:
space:
mode:
authorzippel <zippel@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-22 02:55:07 +0000
committerzippel <zippel@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-22 02:55:07 +0000
commitc9a4672f0222bb6ede790362a3f14397e6db0a05 (patch)
tree0b4d0595823c9e7cba340a59cfc4262f391cc686 /gcc/df-scan.c
parent3af39ab8b34165360524dd5f3da2b1f75fe3afd2 (diff)
downloadgcc-c9a4672f0222bb6ede790362a3f14397e6db0a05.tar.gz
* df-scan.c (df_read_modify_subreg_p): Use REGMODE_NATURAL_SIZE.
(df_def_record_1): Set (DF_REF_READ_WRITE | DF_REF_PARTIAL) for partial register accesses. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125940 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df-scan.c')
-rw-r--r--gcc/df-scan.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 97ce8aad162..61147be59fc 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -2703,7 +2703,8 @@ df_read_modify_subreg_p (rtx x)
return false;
isize = GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)));
osize = GET_MODE_SIZE (GET_MODE (x));
- return (isize > osize && isize > UNITS_PER_WORD);
+ return isize > osize
+ && isize > REGMODE_NATURAL_SIZE (GET_MODE (SUBREG_REG (x)));
}
@@ -2718,7 +2719,6 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
{
rtx *loc;
rtx dst;
- bool dst_in_strict_lowpart = false;
/* We may recursively call ourselves on EXPR_LIST when dealing with PARALLEL
construct. */
@@ -2749,33 +2749,16 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
/* Maybe, we should flag the use of STRICT_LOW_PART somehow. It might
be handy for the reg allocator. */
while (GET_CODE (dst) == STRICT_LOW_PART
- || GET_CODE (dst) == ZERO_EXTRACT
- || df_read_modify_subreg_p (dst))
+ || GET_CODE (dst) == ZERO_EXTRACT)
{
-#if 0
- /* Strict low part always contains SUBREG, but we do not want to make
- it appear outside, as whole register is always considered. */
- if (GET_CODE (dst) == STRICT_LOW_PART)
- {
- loc = &XEXP (dst, 0);
- dst = *loc;
- }
-#endif
+ flags |= DF_REF_READ_WRITE | DF_REF_PARTIAL;
loc = &XEXP (dst, 0);
- if (GET_CODE (dst) == STRICT_LOW_PART)
- dst_in_strict_lowpart = true;
dst = *loc;
- flags |= DF_REF_READ_WRITE;
-
}
- /* Sets to a subreg of a single word register are partial sets if
- they are wrapped in a strict lowpart, and not partial otherwise.
- */
- if (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst))
- && dst_in_strict_lowpart)
- flags |= DF_REF_PARTIAL;
-
+ if (df_read_modify_subreg_p (dst))
+ flags |= DF_REF_READ_WRITE | DF_REF_PARTIAL;
+
if (REG_P (dst)
|| (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst))))
df_ref_record (collection_rec,