Commit cfe37db4 by Fritz Reese Committed by Fritz Reese

decl.c (gfc_match_structure_decl): Make gfc_structure_id static.

2016-08-23  Fritz Reese  <fritzoreese@gmail.com>

	gcc/fortran/
	* decl.c (gfc_match_structure_decl): Make gfc_structure_id static.

	gcc/testsuite/gfortran.dg/
	* dec_structure_12.f90: New testcase.

From-SVN: r239709
parent c0ccddb4
2016-08-23 Fritz Reese <fritzoreese@gmail.com>
* decl.c (gfc_match_structure_decl): Make gfc_structure_id static.
2016-08-23 Fritz Reese <fritzoreese@gmail.com>
* interface.c (compare_components): Fix typo in name check conditional.
2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
......
......@@ -8473,7 +8473,7 @@ match
gfc_match_structure_decl (void)
{
/* Counter used to give unique internal names to anonymous structures. */
int gfc_structure_id = 0;
static unsigned int gfc_structure_id = 0;
char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_symbol *sym;
match m;
......
2016-08-23 Fritz Reese <fritzoreese@gmail.com>
* gfortran.dg/dec_structure_12.f90: New testcase.
2016-08-23 Dominik Vogt <vogt@linux.vnet.ibm.com>
* gcc.target/s390/insv-1.c: Fix test when running with -m31.
......
! { dg-do "compile" }
! { dg-options "-fdec-structure" }
!
! Test a regression where multiple anonymous structures failed to
! receive unique internal names.
!
implicit none
structure /s/
structure record0 ! (2)
integer i
end structure
structure record1 ! regression: Type definition was already defined at (2)
real r
end structure
end structure
record /s/ var
var.record0.i = 0
var.record1.r = 0.0
end
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