aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2001-01-14 12:46:32 -0800
committerPer Bothner <bothner@gcc.gnu.org>2001-01-14 12:46:32 -0800
commit00b4575d1eb041bac1d0b5f46f4e8e1e506de02c (patch)
tree9e4aef705f18edbdce9dd190a5e5106926a873cd /gcc/java/parse.y
parent521b92248e4ce84a4106887ac8104d820037717f (diff)
downloadgcc-00b4575d1eb041bac1d0b5f46f4e8e1e506de02c.zip
gcc-00b4575d1eb041bac1d0b5f46f4e8e1e506de02c.tar.gz
gcc-00b4575d1eb041bac1d0b5f46f4e8e1e506de02c.tar.bz2
parse.y (java_complete_lhs case EXPR_WITH_FILE_LOCATION): If body is constant, return body without wrapper.
* parse.y (java_complete_lhs case EXPR_WITH_FILE_LOCATION): If body is constant, return body without wrapper. (Improves constant folding.) * lex.c (build_wfl_node): Clear TREE_TYPE from returned node. From-SVN: r39017
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 873de30..74e17fe 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -11485,9 +11485,9 @@ java_complete_lhs (node)
EXPR_WFL_NODE (node) = body;
TREE_SIDE_EFFECTS (node) = TREE_SIDE_EFFECTS (body);
CAN_COMPLETE_NORMALLY (node) = CAN_COMPLETE_NORMALLY (body);
- if (body == empty_stmt_node)
+ if (body == empty_stmt_node || TREE_CONSTANT (body))
{
- /* Optimization; makes it easier to detect empty bodies. */
+ /* Makes it easier to constant fold, detect empty bodies. */
return body;
}
if (body == error_mark_node)