diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2003-03-21 18:03:02 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2003-03-21 18:03:02 +0000 |
commit | 6e814b8d35ad3c0ae7415acf0267c085744fd214 (patch) | |
tree | dd3267dc859e7f62e5a0d5c2a6a73470242d735f /gcc/combine.c | |
parent | 91f07c9b578628daaea5cd1644c52077f7114d90 (diff) | |
download | gcc-6e814b8d35ad3c0ae7415acf0267c085744fd214.zip gcc-6e814b8d35ad3c0ae7415acf0267c085744fd214.tar.gz gcc-6e814b8d35ad3c0ae7415acf0267c085744fd214.tar.bz2 |
combine.c (make_field_assignment): Remove unnecessary AND when storing into zero_extract.
* combine.c (make_field_assignment): Remove unnecessary AND
when storing into zero_extract.
From-SVN: r64674
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index b8e91f5..bbbb16e 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -7923,6 +7923,17 @@ make_field_assignment (x) : ((unsigned HOST_WIDE_INT) 1 << len) - 1, dest, 0); + /* If SRC is masked by an AND that does not make a difference in + the value being stored, strip it. */ + if (GET_CODE (assign) == ZERO_EXTRACT + && GET_CODE (XEXP (assign, 1)) == CONST_INT + && INTVAL (XEXP (assign, 1)) < HOST_BITS_PER_WIDE_INT + && GET_CODE (src) == AND + && GET_CODE (XEXP (src, 1)) == CONST_INT + && (INTVAL (XEXP (src, 1)) + == ((unsigned HOST_WIDE_INT) 1 << INTVAL (XEXP (assign, 1))) - 1)) + src = XEXP (src, 0); + return gen_rtx_SET (VOIDmode, assign, src); } |