aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2001-01-17 05:59:51 +0000
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>2001-01-17 05:59:51 +0000
commitdc3799c144c415ccf0dbdee1b6695fb64ac9e842 (patch)
tree8d093ef245b113c99e0bc12aa196e27ca63486a4
parent5dfcd8e17efb3bd1e640307ef3cdaba211cf6051 (diff)
downloadgcc-dc3799c144c415ccf0dbdee1b6695fb64ac9e842.zip
gcc-dc3799c144c415ccf0dbdee1b6695fb64ac9e842.tar.gz
gcc-dc3799c144c415ccf0dbdee1b6695fb64ac9e842.tar.bz2
typeck.c (build_function_call_real): Call fold on the CALL_EXPR.
* typeck.c (build_function_call_real): Call fold on the CALL_EXPR. * call.c (build_over_call): Add comment. From-SVN: r39084
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/call.c4
-rw-r--r--gcc/cp/typeck.c7
3 files changed, 12 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e013065..a3d376b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * typeck.c (build_function_call_real): Call fold on the CALL_EXPR.
+ * call.c (build_over_call): Add comment.
+
2001-01-16 Daniel Berlin <dberlin@redhat.com>
* cvt.c (ocp_convert): Handle vector type conversion
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 5f12f7e..e3613ee 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -1,6 +1,6 @@
/* Functions related to invoking methods and overloaded functions.
Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) and
modified by Brendan Kehoe (brendan@cygnus.com).
@@ -4261,6 +4261,8 @@ build_over_call (cand, args, flags)
return exp;
}
+ /* Some built-in function calls will be evaluated at
+ compile-time in fold (). */
fn = fold (build_call (fn, converted_args));
if (VOID_TYPE_P (TREE_TYPE (fn)))
return fn;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 6a05ef9..fafa55e 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1,6 +1,6 @@
/* Build expressions with type checking for C++ compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC.
@@ -3075,8 +3075,9 @@ build_function_call_real (function, params, require_complete, flags)
return result;
}
- /* C++ */
- result = build_call (function, coerced_params);
+ /* Some built-in function calls will be evaluated at
+ compile-time in fold (). */
+ result = fold (build_call (function, coerced_params));
value_type = TREE_TYPE (result);
if (require_complete)