mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-26 16:51:01 +08:00
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
This commit is contained in:
parent
a476f04689
commit
4c4b47031d
@ -1,3 +1,9 @@
|
||||
2017-01-11 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/50199
|
||||
* lto-lang.c (lto_post_options): Force flag_merge_constants = 1
|
||||
if it was 0.
|
||||
|
||||
2017-01-09 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR translation/79019
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
2017-01-11 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/50199
|
||||
* gcc.dg/lto/pr50199_0.c: New test.
|
||||
|
||||
2017-01-10 Martin Sebor <msebor@redhat.com>
|
||||
|
||||
PR testsuite/78960
|
||||
|
17
gcc/testsuite/gcc.dg/lto/pr50199_0.c
Normal file
17
gcc/testsuite/gcc.dg/lto/pr50199_0.c
Normal file
@ -0,0 +1,17 @@
|
||||
/* PR middle-end/50199 */
|
||||
/* { dg-lto-options {{-O2 -flto -fno-merge-constants --param=lto-min-partition=1}} } */
|
||||
|
||||
__attribute__ ((noinline)) const char *
|
||||
foo (const char *x)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
const char *a = "ab";
|
||||
if (a != foo (a))
|
||||
__builtin_abort ();
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user