diff options
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/combine.c | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cac2479..1be3f95 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-01-02 Adam Nemet <anemet@caviumnetworks.com> + + * combine.c (apply_distributive_law <SUBREG>): Check + TRULY_NOOP_TRUNCATION. + 2006-01-02 Geoffrey Keating <geoffk@apple.com> * dwarf2out.c (have_switched_text_section): Delete. diff --git a/gcc/combine.c b/gcc/combine.c index 1361b10..e9bd667 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -7798,7 +7798,12 @@ apply_distributive_law (rtx x) || (GET_MODE_SIZE (GET_MODE (lhs)) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs)))) || VECTOR_MODE_P (GET_MODE (lhs)) - || GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD) + || GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD + /* Result might need to be truncated. Don't change mode if + explicit truncation is needed. */ + || !TRULY_NOOP_TRUNCATION + (GET_MODE_BITSIZE (GET_MODE (x)), + GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (lhs))))) return x; tem = simplify_gen_binary (code, GET_MODE (SUBREG_REG (lhs)), |