From: Jakub Jelinek Date: Thu, 27 Nov 2014 11:02:02 +0000 (+0100) Subject: re PR lto/64025 (Several testsuite execution failures with -O2 -flto -fuse-linker... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7c7534348a4f6af27f5d17b83356619ad26f73c;p=gcc.git re PR lto/64025 (Several testsuite execution failures with -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects) PR lto/64025 * alias.c (find_base_term): Use std::swap. Prefer tmp2 if it is CONSTANT_P other than CONST_INT. From-SVN: r218119 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 32e0bcb01f0..b1ddd83e3f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-11-27 Jakub Jelinek + + PR lto/64025 + * alias.c (find_base_term): Use std::swap. Prefer tmp2 + if it is CONSTANT_P other than CONST_INT. + 2014-11-27 Thomas Preud'homme PR target/59593 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