Commit 8dff1027 by Mike Stump

92th Cygnus<->FSF quick merge

From-SVN: r14576
parent 5e5b9f69
Fri Aug 1 03:18:15 1997 Jason Merrill <jason@yorick.cygnus.com>
* parse.y: Break out eat_saved_input, handle errors.
Thu Jul 31 17:14:04 1997 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE.
Fri Jul 4 01:45:16 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Make-lang.in (cplib2.txt, cplib2.ready): Instead of checking for
existence of cc1plus check whether $(LANGUAGES) contains C++.
Wed Jul 30 13:04:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* method.c (do_build_copy_constructor): When copying an anonymous
union member loop around to handle nested anonymous unions. Use
the offset of the member relative to the outer structure, not the
union.
Tue Jul 29 21:17:29 1997 Jason Merrill <jason@yorick.cygnus.com> Tue Jul 29 21:17:29 1997 Jason Merrill <jason@yorick.cygnus.com>
* call.c (resolve_args): New fn. * call.c (resolve_args): New fn.
......
...@@ -157,21 +157,23 @@ new2.o: cc1plus $(srcdir)/cp/new2.cc ...@@ -157,21 +157,23 @@ new2.o: cc1plus $(srcdir)/cp/new2.cc
# We want to update cplib2.txt if any of the source files change... # We want to update cplib2.txt if any of the source files change...
cplib2.txt: $(CXX_LIB2SRCS) $(CXX_EXTRA_HEADERS) cplib2.ready cplib2.txt: $(CXX_LIB2SRCS) $(CXX_EXTRA_HEADERS) cplib2.ready
if [ -f cc1plus ]; then \ case " $(LANGUAGES) " in \
echo $(CXX_LIB2FUNCS) > cplib2.new; \ *" "[cC]"++ "*) \
else \ echo $(CXX_LIB2FUNCS) > cplib2.new;; \
echo "" > cplib2.new; \ *) \
fi echo "" > cplib2.new;; \
esac
mv -f cplib2.new cplib2.txt mv -f cplib2.new cplib2.txt
# Or if it would be different. # Or if it would be different.
cplib2.ready: $(GCC_PASSES) $(LANGUAGES) $(LIBGCC2_DEPS) stmp-int-hdrs cplib2.ready: $(GCC_PASSES) $(LANGUAGES) $(LIBGCC2_DEPS) stmp-int-hdrs
@if [ -r cplib2.txt ]; then \ @if [ -r cplib2.txt ]; then \
if [ -f cc1plus ]; then \ case " $(LANGUAGES) " in \
echo $(CXX_LIB2FUNCS) > cplib2.new; \ *" "[cC]"++ "*) \
else \ echo $(CXX_LIB2FUNCS) > cplib2.new;; \
echo "" > cplib2.new; \ *) \
fi; \ echo "" > cplib2.new;; \
esac; \
if cmp -s cplib2.new cplib2.txt; then true; else \ if cmp -s cplib2.new cplib2.txt; then true; else \
touch cplib2.ready; \ touch cplib2.ready; \
fi; \ fi; \
......
...@@ -195,7 +195,7 @@ parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h ...@@ -195,7 +195,7 @@ parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
`echo $(PARSE_C) | sed 's,^\./,,'` `echo $(PARSE_C) | sed 's,^\./,,'`
CONFLICTS = expect 18 shift/reduce conflicts and 39 reduce/reduce conflicts. CONFLICTS = expect 20 shift/reduce conflicts and 39 reduce/reduce conflicts.
$(PARSE_H) : $(PARSE_C) $(PARSE_H) : $(PARSE_C)
$(PARSE_C) : $(srcdir)/parse.y $(PARSE_C) : $(srcdir)/parse.y
@echo $(CONFLICTS) @echo $(CONFLICTS)
......
...@@ -1924,6 +1924,8 @@ do_build_copy_constructor (fndecl) ...@@ -1924,6 +1924,8 @@ do_build_copy_constructor (fndecl)
if (TREE_CODE (field) != FIELD_DECL) if (TREE_CODE (field) != FIELD_DECL)
continue; continue;
init = parm;
if (DECL_NAME (field)) if (DECL_NAME (field))
{ {
if (VFIELD_NAME_P (DECL_NAME (field))) if (VFIELD_NAME_P (DECL_NAME (field)))
...@@ -1939,11 +1941,21 @@ do_build_copy_constructor (fndecl) ...@@ -1939,11 +1941,21 @@ do_build_copy_constructor (fndecl)
&& TREE_CODE (t) == UNION_TYPE && TREE_CODE (t) == UNION_TYPE
&& ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)) && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))
&& TYPE_FIELDS (t) != NULL_TREE) && TYPE_FIELDS (t) != NULL_TREE)
field = largest_union_member (t); {
do
{
init = build (COMPONENT_REF, t, init, field);
field = largest_union_member (t);
}
while ((t = TREE_TYPE (field)) != NULL_TREE
&& TREE_CODE (t) == UNION_TYPE
&& ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))
&& TYPE_FIELDS (t) != NULL_TREE);
}
else else
continue; continue;
init = build (COMPONENT_REF, TREE_TYPE (field), parm, field); init = build (COMPONENT_REF, TREE_TYPE (field), init, field);
init = build_tree_list (NULL_TREE, init); init = build_tree_list (NULL_TREE, init);
current_member_init_list current_member_init_list
...@@ -2017,6 +2029,9 @@ do_build_assign_ref (fndecl) ...@@ -2017,6 +2029,9 @@ do_build_assign_ref (fndecl)
continue; continue;
} }
comp = current_class_ref;
init = parm;
if (DECL_NAME (field)) if (DECL_NAME (field))
{ {
if (VFIELD_NAME_P (DECL_NAME (field))) if (VFIELD_NAME_P (DECL_NAME (field)))
...@@ -2032,12 +2047,23 @@ do_build_assign_ref (fndecl) ...@@ -2032,12 +2047,23 @@ do_build_assign_ref (fndecl)
&& TREE_CODE (t) == UNION_TYPE && TREE_CODE (t) == UNION_TYPE
&& ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)) && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))
&& TYPE_FIELDS (t) != NULL_TREE) && TYPE_FIELDS (t) != NULL_TREE)
field = largest_union_member (t); {
do
{
comp = build (COMPONENT_REF, t, comp, field);
init = build (COMPONENT_REF, t, init, field);
field = largest_union_member (t);
}
while ((t = TREE_TYPE (field)) != NULL_TREE
&& TREE_CODE (t) == UNION_TYPE
&& ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))
&& TYPE_FIELDS (t) != NULL_TREE);
}
else else
continue; continue;
comp = build (COMPONENT_REF, TREE_TYPE (field), current_class_ref, field); comp = build (COMPONENT_REF, TREE_TYPE (field), comp, field);
init = build (COMPONENT_REF, TREE_TYPE (field), parm, field); init = build (COMPONENT_REF, TREE_TYPE (field), init, field);
expand_expr_stmt (build_modify_expr (comp, NOP_EXPR, init)); expand_expr_stmt (build_modify_expr (comp, NOP_EXPR, init));
} }
......
...@@ -363,7 +363,7 @@ lang_extdef: ...@@ -363,7 +363,7 @@ lang_extdef:
; ;
extdef: extdef:
fndef fndef eat_saved_input
{ if (pending_inlines) do_pending_inlines (); } { if (pending_inlines) do_pending_inlines (); }
| datadef | datadef
{ if (pending_inlines) do_pending_inlines (); } { if (pending_inlines) do_pending_inlines (); }
...@@ -374,7 +374,7 @@ extdef: ...@@ -374,7 +374,7 @@ extdef:
assemble_asm ($3); } assemble_asm ($3); }
| extern_lang_string '{' extdefs_opt '}' | extern_lang_string '{' extdefs_opt '}'
{ pop_lang_context (); } { pop_lang_context (); }
| extern_lang_string .hush_warning fndef .warning_ok | extern_lang_string .hush_warning fndef .warning_ok eat_saved_input
{ if (pending_inlines) do_pending_inlines (); { if (pending_inlines) do_pending_inlines ();
pop_lang_context (); } pop_lang_context (); }
| extern_lang_string .hush_warning datadef .warning_ok | extern_lang_string .hush_warning datadef .warning_ok
...@@ -539,8 +539,9 @@ fndef: ...@@ -539,8 +539,9 @@ fndef:
fn.def1 maybe_return_init ctor_initializer_opt compstmt_or_error fn.def1 maybe_return_init ctor_initializer_opt compstmt_or_error
{ finish_function (lineno, (int)$3, 0); } { finish_function (lineno, (int)$3, 0); }
| fn.def1 maybe_return_init function_try_block | fn.def1 maybe_return_init function_try_block
{ if ($<ttype>$) process_next_inline ($<ttype>$); } { }
eat_saved_input | fn.def1 maybe_return_init error
{ }
; ;
constructor_declarator: constructor_declarator:
...@@ -2109,19 +2110,23 @@ fn.defpen: ...@@ -2109,19 +2110,23 @@ fn.defpen:
NULL_TREE, 1); NULL_TREE, 1);
reinit_parse_for_function (); } reinit_parse_for_function (); }
pending_inlines: pending_inline:
/* empty */ fn.defpen maybe_return_init ctor_initializer_opt compstmt_or_error
| pending_inlines fn.defpen maybe_return_init ctor_initializer_opt
compstmt_or_error
{ {
int nested = (hack_decl_function_context int nested = (hack_decl_function_context
(current_function_decl) != NULL_TREE); (current_function_decl) != NULL_TREE);
finish_function (lineno, (int)$4, nested); finish_function (lineno, (int)$3, nested);
process_next_inline ($2); process_next_inline ($1);
} }
| pending_inlines fn.defpen maybe_return_init function_try_block | fn.defpen maybe_return_init function_try_block
{ process_next_inline ($2); } { process_next_inline ($1); }
eat_saved_input | fn.defpen maybe_return_init error
{ process_next_inline ($1); }
;
pending_inlines:
/* empty */
| pending_inlines pending_inline eat_saved_input
; ;
/* A regurgitated default argument. The value of DEFARG_MARKER will be /* A regurgitated default argument. The value of DEFARG_MARKER will be
...@@ -2129,6 +2134,8 @@ pending_inlines: ...@@ -2129,6 +2134,8 @@ pending_inlines:
defarg_again: defarg_again:
DEFARG_MARKER expr_no_commas END_OF_SAVED_INPUT DEFARG_MARKER expr_no_commas END_OF_SAVED_INPUT
{ replace_defarg ($1, $2); } { replace_defarg ($1, $2); }
| DEFARG_MARKER error END_OF_SAVED_INPUT
{ replace_defarg ($1, error_mark_node); }
pending_defargs: pending_defargs:
/* empty */ %prec EMPTY /* empty */ %prec EMPTY
......
...@@ -227,10 +227,8 @@ build_cplus_new (type, init) ...@@ -227,10 +227,8 @@ build_cplus_new (type, init)
rval = build (NEW_EXPR, type, rval = build (NEW_EXPR, type,
TREE_OPERAND (init, 0), TREE_OPERAND (init, 1), slot); TREE_OPERAND (init, 0), TREE_OPERAND (init, 1), slot);
TREE_SIDE_EFFECTS (rval) = 1; TREE_SIDE_EFFECTS (rval) = 1;
TREE_ADDRESSABLE (rval) = 1;
rval = build (TARGET_EXPR, type, slot, rval, NULL_TREE, NULL_TREE); rval = build (TARGET_EXPR, type, slot, rval, NULL_TREE, NULL_TREE);
TREE_SIDE_EFFECTS (rval) = 1; TREE_SIDE_EFFECTS (rval) = 1;
TREE_ADDRESSABLE (rval) = 1;
return rval; return rval;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment