OSDN Git Service

2006-01-16 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Jan 2006 09:40:16 +0000 (09:40 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Jan 2006 09:40:16 +0000 (09:40 +0000)
* trans-expr.c (gfc_conv_function_call): Use fold_build2.
* trans-stmt.c (gfc_trans_goto): Likewise.  Use build_int_cst.
* trans.c (gfc_trans_runtime_check): Don't fold the condition
again.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109745 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/fortran/trans-stmt.c
gcc/fortran/trans.c

index 29a4c77..17baa96 100644 (file)
@@ -1,3 +1,10 @@
+2006-01-16  Richard Guenther  <rguenther@suse.de>
+
+       * trans-expr.c (gfc_conv_function_call): Use fold_build2.
+       * trans-stmt.c (gfc_trans_goto): Likewise.  Use build_int_cst.
+       * trans.c (gfc_trans_runtime_check): Don't fold the condition
+       again.
+
 2006-01-13  Steven G. Kargl  <kargls@comcast.net>
 
        PR fortran/25756
 2006-01-13  Steven G. Kargl  <kargls@comcast.net>
 
        PR fortran/25756
index dc2e822..880994a 100644 (file)
@@ -1830,7 +1830,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
                  /* Check the data pointer hasn't been modified.  This would
                     happen in a function returning a pointer.  */
                  tmp = gfc_conv_descriptor_data_get (info->descriptor);
                  /* Check the data pointer hasn't been modified.  This would
                     happen in a function returning a pointer.  */
                  tmp = gfc_conv_descriptor_data_get (info->descriptor);
-                 tmp = build2 (NE_EXPR, boolean_type_node, tmp, info->data);
+                 tmp = fold_build2 (NE_EXPR, boolean_type_node,
+                                    tmp, info->data);
                  gfc_trans_runtime_check (tmp, gfc_strconst_fault, &se->pre);
                }
              se->expr = info->descriptor;
                  gfc_trans_runtime_check (tmp, gfc_strconst_fault, &se->pre);
                }
              se->expr = info->descriptor;
index df93db6..44d5819 100644 (file)
@@ -162,7 +162,8 @@ gfc_trans_goto (gfc_code * code)
   assign_error =
     gfc_build_cstring_const ("Assigned label is not a target label");
   tmp = GFC_DECL_STRING_LEN (se.expr);
   assign_error =
     gfc_build_cstring_const ("Assigned label is not a target label");
   tmp = GFC_DECL_STRING_LEN (se.expr);
-  tmp = build2 (NE_EXPR, boolean_type_node, tmp, integer_minus_one_node);
+  tmp = fold_build2 (NE_EXPR, boolean_type_node, tmp,
+                    build_int_cst (TREE_TYPE (tmp), -1));
   gfc_trans_runtime_check (tmp, assign_error, &se.pre);
 
   assigned_goto = GFC_DECL_ASSIGN_ADDR (se.expr);
   gfc_trans_runtime_check (tmp, assign_error, &se.pre);
 
   assigned_goto = GFC_DECL_ASSIGN_ADDR (se.expr);
index f1c0e02..08aeef7 100644 (file)
@@ -308,8 +308,6 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock)
   tree tmp;
   tree args;
 
   tree tmp;
   tree args;
 
-  cond = fold (cond);
-
   if (integer_zerop (cond))
     return;
 
   if (integer_zerop (cond))
     return;