From: mrs Date: Fri, 1 Aug 1997 17:21:46 +0000 (+0000) Subject: 92th Cygnus<->FSF quick merge X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=003da05eab7f2bea269d80ed1c9007e75a683c32 92th Cygnus<->FSF quick merge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14576 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 303c72a1c69..6d4c3447b50 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,23 @@ +Fri Aug 1 03:18:15 1997 Jason Merrill + + * parse.y: Break out eat_saved_input, handle errors. + +Thu Jul 31 17:14:04 1997 Jason Merrill + + * tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE. + +Fri Jul 4 01:45:16 1997 Andreas Schwab + + * 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 + + * 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 * call.c (resolve_args): New fn. diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 47cf4de18cc..6748974820d 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -157,21 +157,23 @@ new2.o: cc1plus $(srcdir)/cp/new2.cc # We want to update cplib2.txt if any of the source files change... cplib2.txt: $(CXX_LIB2SRCS) $(CXX_EXTRA_HEADERS) cplib2.ready - if [ -f cc1plus ]; then \ - echo $(CXX_LIB2FUNCS) > cplib2.new; \ - else \ - echo "" > cplib2.new; \ - fi + case " $(LANGUAGES) " in \ + *" "[cC]"++ "*) \ + echo $(CXX_LIB2FUNCS) > cplib2.new;; \ + *) \ + echo "" > cplib2.new;; \ + esac mv -f cplib2.new cplib2.txt # Or if it would be different. cplib2.ready: $(GCC_PASSES) $(LANGUAGES) $(LIBGCC2_DEPS) stmp-int-hdrs @if [ -r cplib2.txt ]; then \ - if [ -f cc1plus ]; then \ - echo $(CXX_LIB2FUNCS) > cplib2.new; \ - else \ - echo "" > cplib2.new; \ - fi; \ + case " $(LANGUAGES) " in \ + *" "[cC]"++ "*) \ + echo $(CXX_LIB2FUNCS) > cplib2.new;; \ + *) \ + echo "" > cplib2.new;; \ + esac; \ if cmp -s cplib2.new cplib2.txt; then true; else \ touch cplib2.ready; \ fi; \ diff --git a/gcc/cp/Makefile.in b/gcc/cp/Makefile.in index b7f3826bdab..cf40fb4d96d 100644 --- a/gcc/cp/Makefile.in +++ b/gcc/cp/Makefile.in @@ -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) \ `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_C) : $(srcdir)/parse.y @echo $(CONFLICTS) diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 7a3a7228867..fb2abeca255 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1924,6 +1924,8 @@ do_build_copy_constructor (fndecl) if (TREE_CODE (field) != FIELD_DECL) continue; + + init = parm; if (DECL_NAME (field)) { if (VFIELD_NAME_P (DECL_NAME (field))) @@ -1939,11 +1941,21 @@ do_build_copy_constructor (fndecl) && TREE_CODE (t) == UNION_TYPE && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)) && 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 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); current_member_init_list @@ -2017,6 +2029,9 @@ do_build_assign_ref (fndecl) continue; } + comp = current_class_ref; + init = parm; + if (DECL_NAME (field)) { if (VFIELD_NAME_P (DECL_NAME (field))) @@ -2032,12 +2047,23 @@ do_build_assign_ref (fndecl) && TREE_CODE (t) == UNION_TYPE && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)) && 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 continue; - comp = build (COMPONENT_REF, TREE_TYPE (field), current_class_ref, field); - init = build (COMPONENT_REF, TREE_TYPE (field), parm, field); + comp = build (COMPONENT_REF, TREE_TYPE (field), comp, field); + init = build (COMPONENT_REF, TREE_TYPE (field), init, field); expand_expr_stmt (build_modify_expr (comp, NOP_EXPR, init)); } diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index fe519b83e73..9c990688b46 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -363,7 +363,7 @@ lang_extdef: ; extdef: - fndef + fndef eat_saved_input { if (pending_inlines) do_pending_inlines (); } | datadef { if (pending_inlines) do_pending_inlines (); } @@ -374,7 +374,7 @@ extdef: assemble_asm ($3); } | extern_lang_string '{' extdefs_opt '}' { 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 (); pop_lang_context (); } | extern_lang_string .hush_warning datadef .warning_ok @@ -539,8 +539,9 @@ fndef: fn.def1 maybe_return_init ctor_initializer_opt compstmt_or_error { finish_function (lineno, (int)$3, 0); } | fn.def1 maybe_return_init function_try_block - { if ($$) process_next_inline ($$); } - eat_saved_input + { } + | fn.def1 maybe_return_init error + { } ; constructor_declarator: @@ -2109,19 +2110,23 @@ fn.defpen: NULL_TREE, 1); reinit_parse_for_function (); } -pending_inlines: - /* empty */ - | pending_inlines fn.defpen maybe_return_init ctor_initializer_opt - compstmt_or_error +pending_inline: + fn.defpen maybe_return_init ctor_initializer_opt compstmt_or_error { int nested = (hack_decl_function_context (current_function_decl) != NULL_TREE); - finish_function (lineno, (int)$4, nested); - process_next_inline ($2); + finish_function (lineno, (int)$3, nested); + process_next_inline ($1); } - | pending_inlines fn.defpen maybe_return_init function_try_block - { process_next_inline ($2); } - eat_saved_input + | fn.defpen maybe_return_init function_try_block + { process_next_inline ($1); } + | 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 @@ -2129,6 +2134,8 @@ pending_inlines: defarg_again: DEFARG_MARKER expr_no_commas END_OF_SAVED_INPUT { replace_defarg ($1, $2); } + | DEFARG_MARKER error END_OF_SAVED_INPUT + { replace_defarg ($1, error_mark_node); } pending_defargs: /* empty */ %prec EMPTY diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index d212bb223d4..2843abdd250 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -227,10 +227,8 @@ build_cplus_new (type, init) rval = build (NEW_EXPR, type, TREE_OPERAND (init, 0), TREE_OPERAND (init, 1), slot); TREE_SIDE_EFFECTS (rval) = 1; - TREE_ADDRESSABLE (rval) = 1; rval = build (TARGET_EXPR, type, slot, rval, NULL_TREE, NULL_TREE); TREE_SIDE_EFFECTS (rval) = 1; - TREE_ADDRESSABLE (rval) = 1; return rval; }