From 910450c13f863770bb095264d2ad17b47befce48 Mon Sep 17 00:00:00 2001 From: Feng Wang Date: Tue, 25 Oct 2005 14:06:22 +0000 Subject: re PR fortran/22290 (Optimize Assigned GOTO to cause error with -O1 or higher) 2005-10-25 Feng Wang PR fortran/22290 * trans-decl.c (gfc_add_assign_aux_vars): New function. Add two auxiliary variables. (gfc_get_symbol_decl): Use it when a variable, including dummy argument, is assigned a label. (gfc_trans_assign_aux_var): New function. Set initial value of the auxiliary variable explicitly. (gfc_trans_deferred_vars): Use it. * trans-stmt.c (gfc_conv_label_variable): Handle dummy argument. 2005-10-25 Feng Wang PR fortran/22290 * gfortran.dg/assign_5.f90: New test. * gfortran.dg/assign_6.f: New test. From-SVN: r105887 --- gcc/fortran/trans-stmt.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/fortran/trans-stmt.c') diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 615d91d..f0fefdc 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -91,6 +91,9 @@ gfc_conv_label_variable (gfc_se * se, gfc_expr * expr) /* Deals with variable in common block. Get the field declaration. */ if (TREE_CODE (se->expr) == COMPONENT_REF) se->expr = TREE_OPERAND (se->expr, 1); + /* Deals with dummy argument. Get the parameter declaration. */ + else if (TREE_CODE (se->expr) == INDIRECT_REF) + se->expr = TREE_OPERAND (se->expr, 0); } /* Translate a label assignment statement. */ -- cgit v1.1