summaryrefslogtreecommitdiff
path: root/gcc/fortran/arith.c
diff options
context:
space:
mode:
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-12 16:53:26 +0000
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-12 16:53:26 +0000
commit02eddeb002eeddbc541f90d5ff5e394fea803b81 (patch)
tree1be65cae232e27fb532bca1c95d395b50376e17f /gcc/fortran/arith.c
parent4462e6acd5318e4b1554f26b2f1093edbb0f5c22 (diff)
downloadgcc-02eddeb002eeddbc541f90d5ff5e394fea803b81.tar.gz
* arith.c (gfc_arith_uplus): Rename to ...
(gfc_arith_identity): ... this. (gfc_parentheses): New function. (gfc_uplus): Adapt to renamed function. * arith.h (gfc_parentheses): Add prototype. * expr.c (gfc_copy_expr): Deal with INTRINSIC_PARENTHESES. (simplifiy_intrinsic_op): Treat INTRINSIC_UPLUS separately from INTRINSIC_PARENTHESES. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123750 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r--gcc/fortran/arith.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index e6c2d0f85d4..8c995ea3b2d 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -595,10 +595,11 @@ check_result (arith rc, gfc_expr *x, gfc_expr *r, gfc_expr **rp)
/* It may seem silly to have a subroutine that actually computes the
unary plus of a constant, but it prevents us from making exceptions
- in the code elsewhere. */
+ in the code elsewhere. Used for unary plus and parenthesized
+ expressions. */
static arith
-gfc_arith_uplus (gfc_expr *op1, gfc_expr **resultp)
+gfc_arith_identity (gfc_expr *op1, gfc_expr **resultp)
{
*resultp = gfc_copy_expr (op1);
return ARITH_OK;
@@ -1763,9 +1764,16 @@ eval_intrinsic_f3 (gfc_intrinsic_op operator,
gfc_expr *
+gfc_parentheses (gfc_expr *op)
+{
+ return eval_intrinsic_f2 (INTRINSIC_PARENTHESES, gfc_arith_identity,
+ op, NULL);
+}
+
+gfc_expr *
gfc_uplus (gfc_expr *op)
{
- return eval_intrinsic_f2 (INTRINSIC_UPLUS, gfc_arith_uplus, op, NULL);
+ return eval_intrinsic_f2 (INTRINSIC_UPLUS, gfc_arith_identity, op, NULL);
}