diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-03-05 09:46:31 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-03-05 09:46:31 +0100 |
commit | 5525ed38b494c33e6c693f1f16bd49abb454d45f (patch) | |
tree | d9e72aff796794255618b803a9b18bc740312cc7 /gcc/tree-ssa-coalesce.c | |
parent | 7af9985b2d8850584c543d9ff5f09ee4e29ed0df (diff) | |
download | gcc-5525ed38b494c33e6c693f1f16bd49abb454d45f.zip gcc-5525ed38b494c33e6c693f1f16bd49abb454d45f.tar.gz gcc-5525ed38b494c33e6c693f1f16bd49abb454d45f.tar.bz2 |
re PR lto/60404 (wrong code by LTO on x86_64-linux-gnu)
PR lto/60404
* cfgexpand.c (expand_used_vars): Do not assume all SSA_NAMEs
of PARM/RESULT_DECLs must be coalesced with optimize && in_lto_p.
* tree-ssa-coalesce.c (coalesce_ssa_name): Use MUST_COALESCE_COST - 1
cost for in_lto_p.
* gcc.dg/lto/pr60404_0.c: New test.
* gcc.dg/lto/pr60404_1.c: New file.
* gcc.dg/lto/pr60404_2.c: New file.
From-SVN: r208340
Diffstat (limited to 'gcc/tree-ssa-coalesce.c')
-rw-r--r-- | gcc/tree-ssa-coalesce.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index 86276b3..9a1ac67 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -1289,9 +1289,12 @@ coalesce_ssa_name (void) _require_ that all the names originating from it be coalesced, because there must be a single partition containing all the names so that it can be assigned - the canonical RTL location of the DECL safely. */ + the canonical RTL location of the DECL safely. + If in_lto_p, a function could have been compiled + originally with optimizations and only the link + performed at -O0, so we can't actually require it. */ const int cost - = TREE_CODE (SSA_NAME_VAR (a)) == VAR_DECL + = (TREE_CODE (SSA_NAME_VAR (a)) == VAR_DECL || in_lto_p) ? MUST_COALESCE_COST - 1 : MUST_COALESCE_COST; add_coalesce (cl, SSA_NAME_VERSION (a), SSA_NAME_VERSION (*slot), cost); |