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/cfgexpand.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/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 5c23b72..dd163a5 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1652,10 +1652,12 @@ expand_used_vars (void) debug info, there is no need to do so if optimization is disabled because all the SSA_NAMEs based on these DECLs have been coalesced into a single partition, which is thus assigned the canonical RTL - location of the DECLs. */ + location of the DECLs. If in_lto_p, we can't rely on optimize, + a function could be compiled with -O1 -flto first and only the + link performed at -O0. */ if (TREE_CODE (SSA_NAME_VAR (var)) == VAR_DECL) expand_one_var (var, true, true); - else if (DECL_IGNORED_P (SSA_NAME_VAR (var)) || optimize) + else if (DECL_IGNORED_P (SSA_NAME_VAR (var)) || optimize || in_lto_p) { /* This is a PARM_DECL or RESULT_DECL. For those partitions that contain the default def (representing the parm or result itself) |