bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: btwowc(EOF) hang with gcc 4.4.2


From: Andreas Schwab
Subject: Re: btwowc(EOF) hang with gcc 4.4.2
Date: Wed, 16 Dec 2009 10:54:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux)

"Alan Curry" <address@hidden> writes:

> Jim Meyering writes:
>> 
>> 
>> The code in question is calling btowc(EOF), which uses
>> this definition from wchar.h:
>> 
>> extern wint_t __btowc_alias (int __c) __asm ("btowc");
>> extern __inline wint_t
>> __NTH (btowc (int __c))
>> { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f'
>>           ? (wint_t) __c : __btowc_alias (__c)); }
>> 
>> Since I don't even see any code that might loop there,
>> (though I didn't look up what __asm ("btowc") does)
>> I'd suspect a compiler problem.
>
> That asm seems to be one of these:
>   http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Asm-Labels.html
>
> It's saying that the function __btowc_alias is actually to be named "btowc"
> in the generated assembly code. This enables the inline function named btowc
> to call an external function also named btowc, by going through that "alias".
> Tricky of them!

If the compiler creates an outline definition of btowc with this body
this will result in an infinite (tail-)recursion.  Normally this
shouldn't happen with extern inline definitions.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]