Patchwork [Fortran,committed] PR57556 - Fix ordering issue in gfc_build_final_call

login
register
mail settings
Submitter Tobias Burnus
Date June 7, 2013, 1:33 p.m.
Message ID <51B1E139.6020301@net-b.de>
Download mbox | patch
Permalink /patch/249725/
State New
Headers show

Comments

Tobias Burnus - June 7, 2013, 1:33 p.m.
It helps to initialize a block before calling "gfc_add_block_to_block 
(&block" ...

Committed as Rev. 199812 after building and regtesting on x86-64-gnu-linux.

Tobias

Patch

Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog	(Revision 199811)
+++ gcc/fortran/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,8 @@ 
+2013-06-07  Tobias Burnus  <burnus@net-b.de>
+
+	PR fortran/57556
+	* trans.c (gfc_build_final_call): Init block before use.
+
 2013-06-06  Tobias Burnus  <burnus@net-b.de>
 
 	PR fortran/57542
Index: gcc/fortran/trans.c
===================================================================
--- gcc/fortran/trans.c	(Revision 199811)
+++ gcc/fortran/trans.c	(Arbeitskopie)
@@ -852,6 +852,7 @@  gfc_build_final_call (gfc_typespec ts, gfc_expr *f
   gcc_assert (final_wrapper->expr_type == EXPR_VARIABLE);
   gcc_assert (var);
 
+  gfc_start_block (&block);
   gfc_init_se (&se, NULL);
   gfc_conv_expr (&se, final_wrapper);
   final_fndecl = se.expr;
@@ -936,7 +937,6 @@  gfc_build_final_call (gfc_typespec ts, gfc_expr *f
   if (!POINTER_TYPE_P (TREE_TYPE (array)))
     array = gfc_build_addr_expr (NULL, array);
 
-  gfc_start_block (&block);
   gfc_add_block_to_block (&block, &se.pre);
   tmp = build_call_expr_loc (input_location,
 			     final_fndecl, 3, array,