This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Fwd: [patch, fortran] Patch PING fix for part of PR17423]
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Feng Wang <wf_cs at yahoo dot com>, Fortran List <fortran at gcc dot gnu dot org>,gcc-patches at gcc dot gnu dot org
- Date: Mon, 09 May 2005 21:03:47 -0700
- Subject: [Fwd: [patch, fortran] Patch PING fix for part of PR17423]
I can not do this myself. Hope someone will :)
-------- Original Message --------
Subject: [patch, fortran] fix for part of PR17423
Date: Fri, 06 May 2005 17:11:14 -0700
From: Jerry DeLisle <jvdelisle@verizon.net>
To: Fortran List <fortran@gcc.gnu.org>, Feng Wang <wf_cs@yahoo.com>
Will someone please review and commit if OK the attached patch and test
file.
bootstrapped and reg tested on i686-pc-linux-gnu
This fixes the ICE noted in comment #9 and #7 of PR 17423.
Regards,
Jerry
? pr17423.diff
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fortran/ChangeLog,v
retrieving revision 1.415
diff -c -3 -p -r1.415 ChangeLog
*** ChangeLog 3 May 2005 18:40:29 -0000 1.415
--- ChangeLog 7 May 2005 00:01:43 -0000
***************
*** 1,3 ****
--- 1,12 ----
+ 2005-05-06 Feng Wang <wf_cs@yahoo.com>
+ 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-03 Kazu Hirata <kazu@cs.umass.edu>
* Make-lang.in, dump-parse-tree.c, invoke.texi, lang.opt,
Index: trans-io.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fortran/trans-io.c,v
retrieving revision 1.35
diff -c -3 -p -r1.35 trans-io.c
*** trans-io.c 17 Apr 2005 20:09:33 -0000 1.35
--- trans-io.c 7 May 2005 00:01:45 -0000
*************** set_string (stmtblock_t * block, stmtblo
*** 394,400 ****
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, len, GFC_DECL_STRING_LEN (se.expr));
}
else
--- 394,400 ----
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, 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: trans-stmt.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fortran/trans-stmt.c,v
retrieving revision 1.28
diff -c -3 -p -r1.28 trans-stmt.c
*** trans-stmt.c 1 Apr 2005 04:16:52 -0000 1.28
--- trans-stmt.c 7 May 2005 00:01:51 -0000
*************** gfc_trans_label_assign (gfc_code * code)
*** 129,135 ****
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);
}
gfc_add_modify_expr (&se.pre, len, len_tree);
--- 129,135 ----
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 (pvoid_type_node, label_tree);
}
gfc_add_modify_expr (&se.pre, len, len_tree);
! { 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