From c6b7404634a291dddfe0e52800b169fd978bc8e4 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Fri, 3 Aug 2001 17:30:22 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/varasm.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 58e465821d36..8916d782a0ed 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-08-03 John David Anglin + + * 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 * gcse.c: Include df.h for use as a dataflow analyzer. diff --git a/gcc/varasm.c b/gcc/varasm.c index 82ad79202505..bb723c8d99a1 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)))); } -- 2.47.2