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: RFA: Testsuite: Fixes for PR44197.c


2010/10/11 Nick Clifton <nickc@redhat.com>:
> Hi Dave,
>
>> ? I don't understand this. ?How did the pre-processed sources come out
>> looking
>> like when you just had plain ULP in the asm? ?If it didn't work, doesn't
>> that
>> mean there is a bug? ?Do we know if the preprocessor handles ANSI C string
>> concatentation inside asms correctly or not?
>
> The answer is that U_L_P is not a string, but a single character. (Despite
> being defined as a string by the various backends that use it). ?So just
> using U_L_P in place, like this:
>
> ?extern
> ?__typeof (__C_ctype_b)
> ? ?__C_ctype_b __asm__ (__USER_LABEL_PREFIX__ "__GI___C_ctype_b")
> ? ?__attribute__ ((visibility ("hidden")));
>
> results in this error message:
>
> ?pr44197.c:17:22: error: expected string literal before '_'
>
> when compiled with the any toolchain that defines U_L_P to a non empty
> string. ?You can also make it happen on other targets (eg i686-pc-linux-gnu)
> by adding the -fleading-underscore switch to the command line. ?The
> preprocessed output looks like this:
>
> ?extern
> ?__typeof (__C_ctype_b)
> ? ?__C_ctype_b __asm__ (_ "__GI___C_ctype_b")
> ? ?__attribute__ ((visibility ("hidden")));
>
>
> Hence the shenanigans with the string-izing macros in order to make the
> pr44197.c code compile.
>
> Cheers
> ?Nick
>

Yes, I know this issue pretty well. I did in the past some magic here
in i386.h for this. See CRT_MKSTR(__USER_LABEL_PREFIX).

Sadly this magic is necessary for i386.

--
Kai

-- 
|? (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


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