diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-27 11:02:02 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-27 11:02:02 +0000 |
commit | da584ec301a67f7f06fb0c085e561756dc752144 (patch) | |
tree | 3536513031953b792c1f0e763e8cbea57a554432 /gcc/alias.c | |
parent | 0e207eb8727a455703a928ead4dc0e237e4d9a58 (diff) | |
download | gcc-da584ec301a67f7f06fb0c085e561756dc752144.tar.gz |
PR lto/64025
* alias.c (find_base_term): Use std::swap. Prefer tmp2
if it is CONSTANT_P other than CONST_INT.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218119 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index 22717ad0fd7..e8675c5d0fd 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1748,11 +1748,11 @@ find_base_term (rtx x) if (REG_P (tmp1) && REG_POINTER (tmp1)) ; else if (REG_P (tmp2) && REG_POINTER (tmp2)) - { - rtx tem = tmp1; - tmp1 = tmp2; - tmp2 = tem; - } + std::swap (tmp1, tmp2); + /* If second argument is constant which has base term, prefer it + over variable tmp1. See PR64025. */ + else if (CONSTANT_P (tmp2) && !CONST_INT_P (tmp2)) + std::swap (tmp1, tmp2); /* Go ahead and find the base term for both operands. If either base term is from a pointer or is a named object or a special address |