This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] fix exec-charset


On Thu, 12 Feb 2004, Eric Christopher wrote:

> > I think you need to be more fine-grained here; couldn't an input operand
> > contain arbitrary expressions including string literals that should be in
> > the execution charset?  I.e., asm_operand should have translation off for
> > the string but on for the expression.
> 
> Got an example to talk about?

asm implementations of string functions (as in glibc's <bits/string.h> and
in Linux) tend to put the asm inside inline functions, but if a macro with
a statement expression were used instead then the arguments of the
function (which could well include string constants) could end up directly
in the asm operands.

In general, if the string is being *interpreted by the compiler* (e.g. asm
constraints), then it isn't translated, if it is being *interpreted by the
compiled code* then it is, and the two cases must be distinguished, and an
asm statement may contain both.  A gray area is strings that are *passed
to the assembler* (e.g. use of asm to rename functions, section names)  
which will need to be considered later when extended identifiers are
supported.

-- 
Joseph S. Myers
jsm@polyomino.org.uk


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