Commit 5a47fc2f by Daniel Franke Committed by Daniel Franke

symbol.c (save_symbol): Don't SAVE function results.

gcc/fortran:
2009-01-03  Daniel Franke  <franke.daniel@gmail.com>

	* symbol.c (save_symbol): Don't SAVE function results.

gcc/testsuite:
2009-01-03  Daniel Franke  <franke.daniel@gmail.com>

	* gfortran.dg/func_result_4.f90: New.

From-SVN: r143039
parent 6280bdbe
2009-01-03 Daniel Franke <franke.daniel@gmail.com>
* symbol.c (save_symbol): Don't SAVE function results.
2009-01-03 Paul Thomas <pault@gcc.gnu.org> 2009-01-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/38594 PR fortran/38594
......
...@@ -3197,6 +3197,7 @@ save_symbol (gfc_symbol *sym) ...@@ -3197,6 +3197,7 @@ save_symbol (gfc_symbol *sym)
if (sym->attr.in_common if (sym->attr.in_common
|| sym->attr.dummy || sym->attr.dummy
|| sym->attr.result
|| sym->attr.flavor != FL_VARIABLE) || sym->attr.flavor != FL_VARIABLE)
return; return;
/* Automatic objects are not saved. */ /* Automatic objects are not saved. */
......
2009-01-03 Daniel Franke <franke.daniel@gmail.com>
* gfortran.dg/func_result_4.f90: New.
2009-01-03 Paul Thomas <pault@gcc.gnu.org> 2009-01-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/38594 PR fortran/38594
......
! { dg-do "compile" }
! { dg-options "-c" }
!
! Do not apply the SAVE attribute to function results.
!
FUNCTION f() RESULT (g)
INTEGER :: g
SAVE
g = 42
END FUNCTION
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment