varasm.c (output_constant): Add new parameter merge_strings.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 4 Oct 2018 17:34:56 +0000 (17:34 +0000)
committerBernd Edlinger <edlinger@gcc.gnu.org>
Thu, 4 Oct 2018 17:34:56 +0000 (17:34 +0000)
commit5e1b4477fa0c1eca86d2b67808ffee5ac969acd4
treecfd084696110a745fb6564ba51735a456eb0932b
parenta81a0bfa4e3ff84538a6e829c72ecfa8651aacd8
varasm.c (output_constant): Add new parameter merge_strings.

2018-10-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * varasm.c (output_constant): Add new parameter merge_strings.
        Make strings properly zero terminated in merge string sections.
        (mergeable_string_section): Don't fail if the last char is non-zero.
        (assemble_variable_contents): Handle merge string sections.
        (assemble_variable): Likewise.
        (assemble_constant_contents): Likewise.
        (output_constant_def_contents): Likewise.
        (output_constructor_array_range,
        output_constructor_regular_field): Adjust call to output_constant.
        (output_object_block): Adjust call to assemble_constant_contents
        and assemble_variable_contents.

testsuie:
2018-10-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * gnat.dg/string_merge1.adb: New test.
        * gnat.dg/string_merge2.adb: New test.
        * gcc.dg/merge-all-constants-1.c: Adjust test.
        * gcc.dg/merge-all-constants-2.c: New test.

From-SVN: r264850
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/merge-all-constants-1.c
gcc/testsuite/gcc.dg/merge-all-constants-2.c [new file with mode: 0644]
gcc/testsuite/gnat.dg/string_merge1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/string_merge2.adb [new file with mode: 0644]
gcc/varasm.c