PR optimization/6871
* varasm.c (assemble_variable): Leave constant zeroes in .rodata.
From-SVN: r64387
+2003-03-14 Jason Merrill <jason@redhat.com>
+
+ PR optimization/6871
+ * varasm.c (assemble_variable): Leave constant zeroes in .rodata.
+
2003-03-14 Neil Booth <neil@daikokuya.co.uk>
* c-opts.c (finish_options): New.
--- /dev/null
+/* PR optimization/6871 */
+/* Constant variables belong in .rodata, not .bss. */
+/* { dg-final { scan-assembler-not "\.bss" } } */
+
+const int i = 0;
else if (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node
|| (flag_zero_initialized_in_bss
+ /* Leave constant zeroes in .rodata so they can be shared. */
+ && !TREE_READONLY (decl)
&& initializer_zerop (DECL_INITIAL (decl))))
{
unsigned HOST_WIDE_INT size = tree_low_cst (DECL_SIZE_UNIT (decl), 1);