OSDN Git Service

2007-03-01 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Mar 2007 08:19:09 +0000 (08:19 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Mar 2007 08:19:09 +0000 (08:19 +0000)
        PR fortran/30865
        * trans-intrinsic.c (gfc_conv_intrinsic_size): Compare pointers.

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

gcc/fortran/ChangeLog
gcc/fortran/trans-intrinsic.c

index 33fa9ad..b804fed 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-01  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/30865
+       * trans-intrinsic.c (gfc_conv_intrinsic_size): Compare pointers.
+
 2007-02-28  Tobias Burnus  <burnus@net-b.de>
            Paul Thomas  <pault@gcc.gnu.org>
 
index 267d7a9..6c08004 100644 (file)
@@ -2723,10 +2723,13 @@ gfc_conv_intrinsic_size (gfc_se * se, gfc_expr * expr)
            && actual->expr->symtree->n.sym->attr.optional)
        {
          tree tmp;
-         tmp = gfc_build_addr_expr (pvoid_type_node,
-                                    argse.expr);
-         tmp = build2 (NE_EXPR, boolean_type_node, tmp, 
-                       build_int_cst (pvoid_type_node, 0));
+         gfc_init_se (&argse, NULL);
+         argse.want_pointer = 1;
+         argse.data_not_needed = 1;
+         gfc_conv_expr (&argse, actual->expr);
+         gfc_add_block_to_block (&se->pre, &argse.pre);
+         tmp = build2 (NE_EXPR, boolean_type_node, argse.expr,
+                       null_pointer_node);
          tmp = gfc_evaluate_now (tmp, &se->pre);
          se->expr = build3 (COND_EXPR, pvoid_type_node,
                             tmp, fncall1, fncall0);