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
+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
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;
}
+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
--- /dev/null
+/* 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;
+}