diff options
author | Richard Biener <rguenther@suse.de> | 2019-11-18 09:44:52 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-11-18 09:44:52 +0000 |
commit | ef50b972e10238a1ac20f23ce3bb32187ae4cb84 (patch) | |
tree | 46e52f480e72e1e9fab0cf6bba96afa267f25dfe | |
parent | 762ff5b304c70c05ec0b98ef3bc458f6e31de514 (diff) | |
download | gcc-ef50b972e10238a1ac20f23ce3bb32187ae4cb84.zip gcc-ef50b972e10238a1ac20f23ce3bb32187ae4cb84.tar.gz gcc-ef50b972e10238a1ac20f23ce3bb32187ae4cb84.tar.bz2 |
re PR target/92462 ([arm32] -ftree-pre makes a variable to be wrongly hoisted out)
2019-11-18 Richard Biener <rguenther@suse.de>
PR rtl-optimization/92462
* alias.c (find_base_term): Restrict the look through ANDs.
(find_base_value): Likewise.
From-SVN: r278391
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/alias.c | 14 |
2 files changed, 16 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e3fab8..f5d4d77 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-11-18 Richard Biener <rguenther@suse.de> + + PR rtl-optimization/92462 + * alias.c (find_base_term): Restrict the look through ANDs. + (find_base_value): Likewise. + 2019-11-18 Georg-Johann Lay <avr@gjlay.de> Add support for AVR devices from the 0-series. diff --git a/gcc/alias.c b/gcc/alias.c index 34e19fe..800b719 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1464,9 +1464,11 @@ find_base_value (rtx src) return find_base_value (XEXP (src, 1)); case AND: - /* If the second operand is constant set the base - address to the first operand. */ - if (CONST_INT_P (XEXP (src, 1)) && INTVAL (XEXP (src, 1)) != 0) + /* Look through aligning ANDs. And AND with zero or one with + the LSB set isn't one (see for example PR92462). */ + if (CONST_INT_P (XEXP (src, 1)) + && INTVAL (XEXP (src, 1)) != 0 + && (INTVAL (XEXP (src, 1)) & 1) == 0) return find_base_value (XEXP (src, 0)); return 0; @@ -2024,7 +2026,11 @@ find_base_term (rtx x, vec<std::pair<cselib_val *, } case AND: - if (CONST_INT_P (XEXP (x, 1)) && INTVAL (XEXP (x, 1)) != 0) + /* Look through aligning ANDs. And AND with zero or one with + the LSB set isn't one (see for example PR92462). */ + if (CONST_INT_P (XEXP (x, 1)) + && INTVAL (XEXP (x, 1)) != 0 + && (INTVAL (XEXP (x, 1)) & 1) == 0) return find_base_term (XEXP (x, 0), visited_vals); return 0; |