C++ PATCH to remove tree-generation during RTL-generation
Mark Mitchell
mark@codesourcery.com
Fri Nov 12 20:48:00 GMT 1999
I found a couple more spots where we were generating trees during the
RTL-generation phase. That's wrong, in function-at-a-time mode.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
1999-11-12 Mark Mitchell <mark@codesourcery.com>
* decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
here.
* semantics.c (finish_expr_stmt): Call it here instead. Move
default_conversion logic to semantic-analysis time.
Index: decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.498
diff -c -p -r1.498 decl.c
*** decl.c 1999/11/12 17:11:06 1.498
--- decl.c 1999/11/13 04:35:55
*************** cplus_expand_expr_stmt (exp)
*** 14155,14161 ****
trying to do TYPE_MODE on the ERROR_MARK, and really
go outside the bounds of the type. */
if (exp != error_mark_node)
! expand_expr_stmt (break_out_cleanups (exp));
}
/* When a stmt has been parsed, this function is called. */
--- 14155,14161 ----
trying to do TYPE_MODE on the ERROR_MARK, and really
go outside the bounds of the type. */
if (exp != error_mark_node)
! expand_expr_stmt (exp);
}
/* When a stmt has been parsed, this function is called. */
Index: semantics.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/semantics.c,v
retrieving revision 1.104
diff -c -p -r1.104 semantics.c
*** semantics.c 1999/11/12 17:11:07 1.104
--- semantics.c 1999/11/13 04:36:22
*************** finish_expr_stmt (expr)
*** 127,143 ****
if (expr != NULL_TREE)
{
if (building_stmt_tree ())
- add_tree (build_min_nt (EXPR_STMT, expr));
- else
{
- emit_line_note (input_filename, lineno);
/* Do default conversion if safe and possibly important,
in case within ({...}). */
! if (!stmts_are_full_exprs_p &&
! ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
! && lvalue_p (expr))
! || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE))
expr = default_conversion (expr);
if (stmts_are_full_exprs_p)
expand_start_target_temps ();
--- 127,150 ----
if (expr != NULL_TREE)
{
if (building_stmt_tree ())
{
/* Do default conversion if safe and possibly important,
in case within ({...}). */
! if (!processing_template_decl
! && !stmts_are_full_exprs_p
! && ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
! && lvalue_p (expr))
! || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE))
expr = default_conversion (expr);
+
+ if (!processing_template_decl)
+ expr = break_out_cleanups (expr);
+
+ add_tree (build_min_nt (EXPR_STMT, expr));
+ }
+ else
+ {
+ emit_line_note (input_filename, lineno);
if (stmts_are_full_exprs_p)
expand_start_target_temps ();
More information about the Gcc-patches
mailing list