]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
varasm.c (output_constant_def_contents): Use for the length of a string constant...
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Fri, 3 Aug 2001 17:30:22 +0000 (17:30 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 3 Aug 2001 17:30:22 +0000 (17:30 +0000)
* varasm.c (output_constant_def_contents): Use for the length of a
string constant either its TREE_STRING_LENGTH or its int_size_in_bytes
depending on which is larger.

From-SVN: r44604

gcc/ChangeLog
gcc/varasm.c

index 58e465821d36af233edec466311ab4aa70e66d55..8916d782a0ed973e03d2fd47726d22d69828930d 100644 (file)
@@ -1,3 +1,9 @@
+2001-08-03  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * varasm.c (output_constant_def_contents): Use for the length of a
+       string constant either its TREE_STRING_LENGTH or its int_size_in_bytes
+       depending on which is larger.
+
 2001-07-16  Daniel Berlin  <dan@cgsoftware.com>
 
         * gcse.c: Include df.h for use as a dataflow analyzer.
index 82ad792025058b38a72a3f39ef71a1eff04391fd..bb723c8d99a137ef8e3f18be49550e86da2d1af1 100644 (file)
@@ -3116,7 +3116,8 @@ output_constant_def_contents (exp, reloc, labelno)
   /* Output the value of EXP.  */
   output_constant (exp,
                   (TREE_CODE (exp) == STRING_CST
-                   ? TREE_STRING_LENGTH (exp)
+                   ? MAX (TREE_STRING_LENGTH (exp),
+                          int_size_in_bytes (TREE_TYPE (exp)))
                    : int_size_in_bytes (TREE_TYPE (exp))));
 
 }