With one Fortran file, I get the following assembler errors:

/tmp/cc28epKK.s:2075: Error: junk `@1.2304+16' after expression

That's due to the way a temporary variable is generated. While that variable is local to the procedure, the name somehow escapes into the assembler file. The dump looks as follows.

  static struct foo DA@0;
  static struct universal DA@1;
  static struct universal DA@2;
...
    class.30._data = &DA@0.foo_parent.universal.counter;

I have now changed the mangling, see attached patch. (The test file uses finalization - hence, I do not include it into the patch. I will include it in the FINAL patch.)

Build and regtested on x86-64-gnu-linux.
OK for the trunk?

Tobias
2013-05-22  Tobias Burnus  <bur...@net-b.de>

	* resolve.c (get_temp_from_expr): Fix temp var mangling.

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 6f32df8..5fabc9a 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -9254,7 +9254,7 @@ get_temp_from_expr (gfc_expr *e, gfc_namespace *ns)
   gfc_array_ref *aref;
   gfc_ref *ref;
 
-  sprintf (name, "DA@%d", serial++);
+  sprintf (name, "DA" GFC_PREFIX("%d"), serial++);
   gfc_get_sym_tree (name, ns, &tmp, false);
   gfc_add_type (tmp->n.sym, &e->ts, NULL);
 

Reply via email to