This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, fortran] PR46678 Wrong code with strings

Hi all,

This patch is simple and obvious. Credit goes to Tobias for the idea. I tracked down the correct function to put this and fixed up a test case.

Regression tested on x86-64-linux-gnu.

As a side note, I tested changing all cases of gfc_start_block with gfc_init_block in trans-decl.c and also got no regressions. I leave that idea for later discussion.

Test case attached.

OK for Trunk?


2010-11-27  Tobias Burnus  <>
	    Jerry DeLisle  <>

	PR fortran/46678
	trans-decl.c (gfc_trans_auto_character_variable): Use gfc_init_block
	instead of gfc_start_block.
Index: trans-decl.c
--- trans-decl.c	(revision 167208)
+++ trans-decl.c	(working copy)
@@ -2952,7 +2968,7 @@ gfc_trans_auto_character_variable (gfc_symbol * sy
   gcc_assert (sym->backend_decl);
   gcc_assert (sym-> && sym->>length);
-  gfc_start_block (&init);
+  gfc_init_block (&init);
   /* Evaluate the string length expression.  */
   gfc_conv_string_length (sym->, NULL, &init);

Attachment: deferred_char_len_1.f90
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]