diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-01-11 09:40:59 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-01-11 09:40:59 +0100 |
commit | 4c4b47031d4bcbf116cbc3c479933adf14b2b4fe (patch) | |
tree | eb8e4fca20eece89c2e2363b589bcc9a85df7417 /gcc/lto/lto-lang.c | |
parent | a476f04689b31d139f976d3ef8c80631ca52c591 (diff) | |
download | gcc-4c4b47031d4bcbf116cbc3c479933adf14b2b4fe.zip gcc-4c4b47031d4bcbf116cbc3c479933adf14b2b4fe.tar.gz gcc-4c4b47031d4bcbf116cbc3c479933adf14b2b4fe.tar.bz2 |
re PR middle-end/50199 (wrong code with -flto -fno-merge-constants)
PR middle-end/50199
* lto-lang.c (lto_post_options): Force flag_merge_constants = 1
if it was 0.
* gcc.dg/lto/pr50199_0.c: New test.
From-SVN: r244304
Diffstat (limited to 'gcc/lto/lto-lang.c')
-rw-r--r-- | gcc/lto/lto-lang.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index c2b49dc..fccb8c6 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -857,6 +857,12 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED) support. */ flag_excess_precision_cmdline = EXCESS_PRECISION_FAST; + /* When partitioning, we can tear appart STRING_CSTs uses from the same + TU into multiple partitions. Without constant merging the constants + might not be equal at runtime. See PR50199. */ + if (!flag_merge_constants) + flag_merge_constants = 1; + /* Initialize the compiler back end. */ return false; } |