This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] Create valid temporary variable to avoid assembler errors


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]