This is the mail archive of the gcc-patches@gcc.gnu.org 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, committed] Fix PR 53148


Hello world,

I have committed the attached patch as obvious as rev. 186942
after regression-testing.  Will also commit to 4.7 in a few
days.

Thomas

2012-04-29 Thomas Koenig <tkoenig@gcc.gnu.org>

        PR fortran/53148
        * frontend-passes.c (create_var):  If the statement has a label,
        put the label around the block.

2012-04-29 Thomas Koenig <tkoenig@gcc.gnu.org>

        PR fortran/53148
        * gfortran.dg/function_optimize_12.f90:  New test.

Attachment: function_optimize_12.f90
Description: Text document

Index: frontend-passes.c
===================================================================
--- frontend-passes.c	(Revision 186549)
+++ frontend-passes.c	(Arbeitskopie)
@@ -271,6 +271,16 @@ create_var (gfc_expr * e)
       inserted_block->ext.block.assoc = NULL;
 
       ns->code = *current_code;
+
+      /* If the statement has a label,  make sure it is transferred to
+	 the newly created block.  */
+
+      if ((*current_code)->here) 
+	{
+	  inserted_block->here = (*current_code)->here;
+	  (*current_code)->here = NULL;
+	}
+
       inserted_block->next = (*current_code)->next;
       changed_statement = &(inserted_block->ext.block.ns->code);
       (*current_code)->next = NULL;

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