diff options
author | Andrew Pinski <apinski@cavium.com> | 2014-10-15 00:38:03 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2014-10-14 17:38:03 -0700 |
commit | ceeb2cbc4f3717ad6eb58e8e931dc6bff3f96fa0 (patch) | |
tree | c19b58b565b5abde050d7f66f273c32d8cc9bdd6 | |
parent | e24ad4ec6055aaa7424e7ba7e97c850c26821531 (diff) | |
download | gcc-ceeb2cbc4f3717ad6eb58e8e931dc6bff3f96fa0.zip gcc-ceeb2cbc4f3717ad6eb58e8e931dc6bff3f96fa0.tar.gz gcc-ceeb2cbc4f3717ad6eb58e8e931dc6bff3f96fa0.tar.bz2 |
revert: re PR middle-end/49721 (convert_memory_address_addr_space may generate invalid new insns)
2014-10-14 Andrew Pinski <apinski@cavium.com>
Revert:
2011-08-19 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/49721
* explow.c (convert_memory_address_addr_space): Also permute the
conversion and addition of constant for zero-extend.
From-SVN: r216229
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/explow.c | 19 |
2 files changed, 16 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 830c12f..34fbb35 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2014-10-14 Andrew Pinski <apinski@cavium.com> + + Revert: + 2011-08-19 H.J. Lu <hongjiu.lu@intel.com> + + PR middle-end/49721 + * explow.c (convert_memory_address_addr_space): Also permute the + conversion and addition of constant for zero-extend. + 2014-10-14 DJ Delorie <dj@redhat.com> * config/msp430/msp430-modes.def (PSI): Add. diff --git a/gcc/explow.c b/gcc/explow.c index 8470691..3ba766d 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -376,23 +376,18 @@ convert_memory_address_addr_space (enum machine_mode to_mode ATTRIBUTE_UNUSED, case PLUS: case MULT: - /* FIXME: For addition, we used to permute the conversion and - addition operation only if one operand is a constant and - converting the constant does not change it or if one operand - is a constant and we are using a ptr_extend instruction - (POINTERS_EXTEND_UNSIGNED < 0) even if the resulting address - may overflow/underflow. We relax the condition to include - zero-extend (POINTERS_EXTEND_UNSIGNED > 0) since the other - parts of the compiler depend on it. See PR 49721. - + /* For addition we can safely permute the conversion and addition + operation if one operand is a constant and converting the constant + does not change it or if one operand is a constant and we are + using a ptr_extend instruction (POINTERS_EXTEND_UNSIGNED < 0). We can always safely permute them if we are making the address narrower. */ if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode) || (GET_CODE (x) == PLUS && CONST_INT_P (XEXP (x, 1)) - && (POINTERS_EXTEND_UNSIGNED != 0 - || XEXP (x, 1) == convert_memory_address_addr_space - (to_mode, XEXP (x, 1), as)))) + && (XEXP (x, 1) == convert_memory_address_addr_space + (to_mode, XEXP (x, 1), as) + || POINTERS_EXTEND_UNSIGNED < 0))) return gen_rtx_fmt_ee (GET_CODE (x), to_mode, convert_memory_address_addr_space (to_mode, XEXP (x, 0), as), |