This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] Create valid temporary variable to avoid assembler errors
- From: Tobias Burnus <burnus at net-b dot de>
- To: fortran at gcc dot gnu dot org
- Date: Wed, 22 May 2013 21:26:31 +0200
- Subject: Re: [Patch, Fortran] Create valid temporary variable to avoid assembler errors
- References: <519CD449 dot 6060305 at net-b dot de> <CABu31nN6OUMrEdd6tuxQs6T83HboDy5jVRuunVyJo4Jhjt+cHA at mail dot gmail dot com>
Steven Bosscher wrote:
Hm, DA_F_0 is a valid variable name. So can't your patch cause clashes
with user names?
Maybe I should change the order, by having _F_DA0 - one never knows
where DA_F_0 gets exposed. In principle, it should be a local variable
name which isn't seen by anyone (except with debugging symbols). But as
the assembler failure showed, it can get escape and be at least visible
to the debugger.
As local Fortran variable, DA_F_0 cannot be generated as all (g)fortran
variable names are converted to lower space; using C binding, one can
generate such a name (and also "_F_DA_0"). But that is a global variable
should be a different tree decl and, hence, confusingly in the dump but
not overlapping. On the other hand, I still do not completely understand
why the name leaks to the assembler - thus, I wouldn't rule out anything.
Side note: If the assembler supports it, the name has a dot or a $ in
the name, which makes clashes even less likely.
I have now changed it to:
- sprintf (name, "DA" GFC_PREFIX("%d"), serial++);
+ sprintf (name, GFC_PREFIX("DA%d"), serial++);
Thanks for the comment.
Tobias