From 30b50f906e0b45b53cb9d4b4e996bfc245f908c5 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sat, 4 May 2002 13:26:13 +0000 Subject: [PATCH] For PR java/6519: * parse.y (build_string_concatenation): Return just op1 only when op2 is null and op1 is a STRING_CST, otherwise always construct a StringBuffer. From-SVN: r53158 --- gcc/java/ChangeLog | 7 +++++++ gcc/java/parse.y | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 461f1305804..a4b7a38ebdd 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2002-05-04 Mark Wielaard + + For PR java/6519: + * parse.y (build_string_concatenation): Return just op1 only when op2 + is null and op1 is a STRING_CST, otherwise always construct a + StringBuffer. + 2002-04-27 Tom Tromey For PR java/6382: diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 00f064d9644..c45ff1ecae8 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -13834,8 +13834,8 @@ build_string_concatenation (op1, op2) op2 = patch_string_cst (op2); /* If either one of the constant is null and the other non null - operand is a String object, return it. */ - if (JSTRING_TYPE_P (TREE_TYPE (op1)) && !op2) + operand is a String constant, return it. */ + if ((TREE_CODE (op1) == STRING_CST) && !op2) return op1; /* If OP1 isn't already a StringBuffer, create and -- 2.30.2