OSDN Git Service

2008-09-04 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Sep 2008 19:32:02 +0000 (19:32 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Sep 2008 19:32:02 +0000 (19:32 +0000)
* trans-array.c (gfc_conv_array_parameter): Use correct types
in building COND_EXPRs.
* trans-expr.c (gfc_conv_missing_dummy): Likewise.
* trans-intrinsics.c (gfc_conv_intrinsic_merge): Likewise.

* gfortran.dg/internal_pack_4.f90: Adjust pattern.

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

gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/fortran/trans-expr.c
gcc/fortran/trans-intrinsic.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/internal_pack_4.f90

index 23dfbdf..459aeb9 100644 (file)
@@ -1,3 +1,10 @@
+2008-09-04  Richard Guenther  <rguenther@suse.de>
+
+       * trans-array.c (gfc_conv_array_parameter): Use correct types
+       in building COND_EXPRs.
+       * trans-expr.c (gfc_conv_missing_dummy): Likewise.
+       * trans-intrinsics.c (gfc_conv_intrinsic_merge): Likewise.
+
 2008-09-04  Daniel Kraft  <d@domob.eu>
 
        * PR fortran/37099
index 2d574a3..e0ebbf0 100644 (file)
@@ -5250,8 +5250,9 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77,
       if (fsym && fsym->attr.optional && sym && sym->attr.optional)
        {
          tmp = gfc_conv_expr_present (sym);
-         ptr = build3 (COND_EXPR, TREE_TYPE (se->expr), tmp, ptr,
-                       null_pointer_node);
+         ptr = build3 (COND_EXPR, TREE_TYPE (se->expr), tmp,
+                       fold_convert (TREE_TYPE (se->expr), ptr),
+                       fold_convert (TREE_TYPE (se->expr), null_pointer_node));
        }
 
       ptr = gfc_evaluate_now (ptr, &se->pre);
index 8ebda49..d253976 100644 (file)
@@ -161,7 +161,8 @@ gfc_conv_missing_dummy (gfc_se * se, gfc_expr * arg, gfc_typespec ts, int kind)
       tmp = fold_convert (tmp, build_fold_indirect_ref (se->expr));
     
       /* Test for a NULL value.  */
-      tmp = build3 (COND_EXPR, TREE_TYPE (tmp), present, tmp, integer_one_node);
+      tmp = build3 (COND_EXPR, TREE_TYPE (tmp), present, tmp,
+                   fold_convert (TREE_TYPE (tmp), integer_one_node));
       tmp = gfc_evaluate_now (tmp, &se->pre);
       se->expr = build_fold_addr_expr (tmp);
     }
index ecb5687..aa5ee45 100644 (file)
@@ -2918,7 +2918,8 @@ gfc_conv_intrinsic_merge (gfc_se * se, gfc_expr * expr)
       se->string_length = len;
     }
   type = TREE_TYPE (tsource);
-  se->expr = fold_build3 (COND_EXPR, type, mask, tsource, fsource);
+  se->expr = fold_build3 (COND_EXPR, type, mask, tsource,
+                         fold_convert (type, fsource));
 }
 
 
index 9be16a8..6849f7c 100644 (file)
@@ -1,3 +1,7 @@
+2008-09-04  Richard Guenther  <rguenther@suse.de>
+
+       * gfortran.dg/internal_pack_4.f90: Adjust pattern.
+
 2008-09-04  Daniel Kraft  <d@domob.eu>
 
        PR fortran/37099
index 049931a..0bcfc79 100644 (file)
@@ -26,6 +26,6 @@ USE M1
 CALL S2()
 END
 
-! { dg-final { scan-tree-dump-times "a != 0B \\? _gfortran_internal_pack" 1 "original" } }
+! { dg-final { scan-tree-dump-times "a != 0B \\? \\\(.*\\\) _gfortran_internal_pack" 1 "original" } }
 ! { dg-final { scan-tree-dump-times "if \\(a != 0B &&" 1 "original" } }
 ! { dg-final { cleanup-tree-dump "original" } }