varasm.c (mergeable_string_section): Don't try to move zero-length strings to the...
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 10 Oct 2018 18:32:47 +0000 (18:32 +0000)
committerBernd Edlinger <edlinger@gcc.gnu.org>
Wed, 10 Oct 2018 18:32:47 +0000 (18:32 +0000)
2018-10-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * varasm.c (mergeable_string_section): Don't try to move zero-length
        strings to the merge section.

From-SVN: r265025

gcc/ChangeLog
gcc/varasm.c

index b1f4d7f5eb799f4a813cbac591aed8ead213615c..81171bedf334463d1ca18d99b39be46f9431aa73 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       * varasm.c (mergeable_string_section): Don't try to move zero-length
+       strings to the merge section.
+
 2018-10-10  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/87573
index c789a03e1f3403f37f4f00a7d124f3e7e8f5e4ed..78cb000ca04ae5918dd29a990d0e6147838232ae 100644 (file)
@@ -804,7 +804,7 @@ mergeable_string_section (tree decl ATTRIBUTE_UNUSED,
       && TREE_CODE (decl) == STRING_CST
       && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE
       && align <= 256
-      && (len = int_size_in_bytes (TREE_TYPE (decl))) >= 0
+      && (len = int_size_in_bytes (TREE_TYPE (decl))) > 0
       && TREE_STRING_LENGTH (decl) == len)
     {
       scalar_int_mode mode;