2005-05-15 Feng Wang <fengwang@nudt.edu.cn>
authorfengwang <fengwang@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 15 May 2005 02:45:29 +0000 (02:45 +0000)
committerfengwang <fengwang@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 15 May 2005 02:45:29 +0000 (02:45 +0000)
        Jerry DeLisle <jvdelisle@verizon.net>

        PR fortran/17432
        * trans-stmt.c (gfc_trans_label_assign): fix pointer type, to
        resolve ICE on assign of format label.
        * trans-io.c (set_string): add fold-convert to properly
        handle assigned format label in write.

2005-05-15  Jerry DeLisle <jvdelisle@verizon.net>

        PR fortran/17432
        * gfortran.dg/assign_4.f: New test.

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

gcc/fortran/ChangeLog
gcc/fortran/trans-io.c
gcc/fortran/trans-stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/assign_4.f [new file with mode: 0644]

index 76cd9f9..5cfe135 100644 (file)
@@ -1,3 +1,12 @@
+2005-05-15  Feng Wang <fengwang@nudt.edu.cn>
+       Jerry DeLisle <jvdelisle@verizon.net>
+
+       PR fortran/17432
+       * trans-stmt.c (gfc_trans_label_assign): fix pointer type, to 
+       resolve ICE on assign of format label.
+       * trans-io.c (set_string): add fold-convert to properly
+       handle assigned format label in write.
 2005-05-13  Paul Brook  <paul@codesourcery.com>
 
        * trans-stmt.c (gfc_trans_forall_1): Fix comment typo.
index 8701d5e..a8f8ce8 100644 (file)
@@ -394,7 +394,8 @@ set_string (stmtblock_t * block, stmtblock_t * postblock, tree var,
       tmp = build2 (LE_EXPR, boolean_type_node,
                    tmp, convert (TREE_TYPE (tmp), integer_minus_one_node));
       gfc_trans_runtime_check (tmp, msg, &se.pre);
-      gfc_add_modify_expr (&se.pre, io, GFC_DECL_ASSIGN_ADDR (se.expr));
+      gfc_add_modify_expr (&se.pre, io,
+                fold_convert (TREE_TYPE (io), GFC_DECL_ASSIGN_ADDR (se.expr)));
       gfc_add_modify_expr (&se.pre, len, GFC_DECL_STRING_LEN (se.expr));
     }
   else
index 60a786c..b895996 100644 (file)
@@ -129,7 +129,7 @@ gfc_trans_label_assign (gfc_code * code)
       label_len = code->label->format->value.character.length;
       len_tree = build_int_cst (NULL_TREE, label_len);
       label_tree = gfc_build_string_const (label_len + 1, label_str);
-      label_tree = gfc_build_addr_expr (pchar_type_node, label_tree);
+      label_tree = gfc_build_addr_expr (pvoid_type_node, label_tree);
     }
 
   gfc_add_modify_expr (&se.pre, len, len_tree);
index 09b2cb7..9e23938 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-15  Jerry DeLisle <jvdelisle@verizon.net>
+
+       PR fortran/17432
+       * gfortran.dg/assign_4.f: New test.
+
 2005-05-14  Kazu Hirata  <kazu@cs.umass.edu>
 
        PR tree-optimization/21563
diff --git a/gcc/testsuite/gfortran.dg/assign_4.f b/gcc/testsuite/gfortran.dg/assign_4.f
new file mode 100644 (file)
index 0000000..3277f7c
--- /dev/null
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! Option passed to avoid excess errors from obsolete warning
+! { dg-options "-w" }
+! PR17423
+      program testit
+c
+      assign 12 to i
+      write(*, i) 
+ 0012 format (" **** ASSIGN FORMAT NUMBER TO INTEGER VARIABLE ****" )
+      end
+