aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1997-11-02 14:19:36 -0700
committerJeff Law <law@gcc.gnu.org>1997-11-02 14:19:36 -0700
commite9a25f70a0a7b82881b56cb3dfa7422b2968682a (patch)
tree46fe768360493f03f7282d07762e7b26c292aabd /gcc/cp
parentbb84e66919817020267815eed4304e543688e722 (diff)
downloadgcc-e9a25f70a0a7b82881b56cb3dfa7422b2968682a.zip
gcc-e9a25f70a0a7b82881b56cb3dfa7422b2968682a.tar.gz
gcc-e9a25f70a0a7b82881b56cb3dfa7422b2968682a.tar.bz2
Update mainline egcs to gcc2 snapshot 971021.
From-SVN: r16278
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/Make-lang.in4
-rw-r--r--gcc/cp/decl.c3
-rw-r--r--gcc/cp/parse.c6
-rw-r--r--gcc/cp/parse.h3
-rw-r--r--gcc/cp/typeck.c30
6 files changed, 42 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 20ca7e1..bb27b8c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -77,6 +77,15 @@ Mon Oct 20 10:52:22 1997 Jason Merrill <jason@yorick.cygnus.com>
(common_type): Likewise.
* error.c (args_as_string): Recognize null_node.
+Sun Oct 19 09:13:01 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * typeck.c (rationalize_conditional_expr): Handle {MIN,MAX}_EXPR.
+ (unary_complex_lvalue): Call it for {MIN,MAX}_EXPR.
+
+ * decl.c (init_decl_processing): Call using_eh_for_cleanups.
+
+ * Make-lang.in (g++): Include prefix.o.
+
Thu Oct 16 15:31:09 1997 Judy Goldberg <judygold@sanwafp.com>
* pt.c (determine_explicit_specialization): Initialize "dummy"
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 3d14dfa..78123ef 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -90,8 +90,8 @@ g++.o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) g++.c
-c g++.c
# Create the compiler driver for g++.
-g++$(exeext): g++.o g++spec.o version.o choose-temp.o pexecute.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ g++.o g++spec.o version.o \
+g++$(exeext): g++.o g++spec.o version.o choose-temp.o pexecute.o prefix.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ g++.o g++spec.o prefix.o version.o \
choose-temp.o pexecute.o $(EXTRA_GCC_OBJS) $(LIBS)
# Create a version of the g++ driver which calls the cross-compiler.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index ca21b48..77f5fd5 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -5585,6 +5585,9 @@ init_decl_processing ()
/* Prepare to check format strings against argument lists. */
init_function_format_info ();
+
+ /* Show we use EH for cleanups. */
+ using_eh_for_cleanups ();
}
/* initialize type descriptor type node of various rtti type. */
diff --git a/gcc/cp/parse.c b/gcc/cp/parse.c
index 80ac220..9aa05f3 100644
--- a/gcc/cp/parse.c
+++ b/gcc/cp/parse.c
@@ -3495,7 +3495,7 @@ static const short yycheck[] = { 4,
78, 79, 80, 81, 82, 83, 84, 85
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/lib/bison.simple"
+#line 3 "/usr/cygnus/latest-940103/share/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -3688,7 +3688,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
-#line 196 "/usr/lib/bison.simple"
+#line 196 "/usr/cygnus/latest-940103/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -8425,7 +8425,7 @@ case 830:
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/lib/bison.simple"
+#line 498 "/usr/cygnus/latest-940103/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
diff --git a/gcc/cp/parse.h b/gcc/cp/parse.h
index f45eb6f..4ebcff2 100644
--- a/gcc/cp/parse.h
+++ b/gcc/cp/parse.h
@@ -89,4 +89,5 @@ typedef union {long itype; tree ttype; char *strtype; enum tree_code code; flagg
extern YYSTYPE yylval;
-#define YYEMPTY -2
+#define YYEMPTY -2
+
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index aafea54..4b774d2 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1681,18 +1681,33 @@ build_component_ref_1 (datum, field, protect)
(build_component_ref (datum, field, NULL_TREE, protect));
}
-/* Given a COND_EXPR in T, return it in a form that we can, for
- example, use as an lvalue. This code used to be in unary_complex_lvalue,
- but we needed it to deal with `a = (d == c) ? b : c' expressions, where
- we're dealing with aggregates. So, we now call this in unary_complex_lvalue,
- and in build_modify_expr. The case (in particular) that led to this was
- with CODE == ADDR_EXPR, since it's not an lvalue when we'd get it there. */
+/* Given a COND_EXPR, MIN_EXPR, or MAX_EXPR in T, return it in a form that we
+ can, for example, use as an lvalue. This code used to be in
+ unary_complex_lvalue, but we needed it to deal with `a = (d == c) ? b : c'
+ expressions, where we're dealing with aggregates. But now it's again only
+ called from unary_complex_lvalue. The case (in particular) that led to
+ this was with CODE == ADDR_EXPR, since it's not an lvalue when we'd
+ get it there. */
static tree
rationalize_conditional_expr (code, t)
enum tree_code code;
tree t;
{
+ /* For MIN_EXPR or MAX_EXPR, fold-const.c has arranged things so that
+ the first operand is always the one to be used if both operands
+ are equal, so we know what conditional expression this used to be. */
+ if (TREE_CODE (t) == MIN_EXPR || TREE_CODE (t) == MAX_EXPR)
+ {
+ return
+ build_conditional_expr (build_x_binary_op ((TREE_CODE (t) == MIN_EXPR
+ ? LE_EXPR : GE_EXPR),
+ TREE_OPERAND (t, 0),
+ TREE_OPERAND (t, 1)),
+ build_unary_op (code, TREE_OPERAND (t, 0), 0),
+ build_unary_op (code, TREE_OPERAND (t, 1), 0));
+ }
+
return
build_conditional_expr (TREE_OPERAND (t, 0),
build_unary_op (code, TREE_OPERAND (t, 1), 0),
@@ -4584,7 +4599,8 @@ unary_complex_lvalue (code, arg)
}
/* Handle (a ? b : c) used as an "lvalue". */
- if (TREE_CODE (arg) == COND_EXPR)
+ if (TREE_CODE (arg) == COND_EXPR
+ || TREE_CODE (arg) == MIN_EXPR || TREE_CODE (arg) == MAX_EXPR)
return rationalize_conditional_expr (code, arg);
if (TREE_CODE (arg) == MODIFY_EXPR