aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>2001-08-03 17:30:22 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2001-08-03 17:30:22 +0000
commitc6b7404634a291dddfe0e52800b169fd978bc8e4 (patch)
treee5a398421a20c710768ef2f14bd2aff5f3f15372 /gcc
parentadfcce6198effc2aaeb4961ab7a8ec05723d6573 (diff)
downloadgcc-c6b7404634a291dddfe0e52800b169fd978bc8e4.zip
gcc-c6b7404634a291dddfe0e52800b169fd978bc8e4.tar.gz
gcc-c6b7404634a291dddfe0e52800b169fd978bc8e4.tar.bz2
varasm.c (output_constant_def_contents): Use for the length of a string constant either its TREE_STRING_LENGTH or its...
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/varasm.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 58e4658..8916d78 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 82ad792..bb723c8 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -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))));
}