[Bug c/42440] optimization bug with btwowc(EOF) in wchar.h

2009-12-19 Thread pinskia at gcc dot gnu dot org
--- Comment #2 from pinskia at gcc dot gnu dot org 2009-12-20 03:41 --- So we have: extern wint_t __btowc_alias (int __c) __asm ("btowc"); extern __inline wint_t __attribute__ ((__nothrow__)) btowc (int __c) { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' ? (wint_

[Bug c/42440] optimization bug with btwowc(EOF) in wchar.h

2009-12-20 Thread rguenth at gcc dot gnu dot org
--- Comment #3 from rguenth at gcc dot gnu dot org 2009-12-20 13:11 --- Works for me. The preprocessed source is certainly not what was compiled (I assume the linkage specification of btowc was actually different). Working testcase, robustened against -std=c99: extern int __btowc_alia

[Bug c/42440] optimization bug with btwowc(EOF) in wchar.h

2009-12-20 Thread karl at freefriends dot org
--- Comment #4 from karl at freefriends dot org 2009-12-20 23:09 --- > Works for me. The preprocessed source is certainly not what was compiled Yes, it was. But I apologize, the invocation needs to include -std=gnu99 to observe the problem, e.g., gcc -std=gnu99 -O2 conftest.i. Withou

[Bug c/42440] optimization bug with btwowc(EOF) in wchar.h

2009-12-20 Thread jakub at gcc dot gnu dot org
--- Comment #5 from jakub at gcc dot gnu dot org 2009-12-21 00:23 --- If so, then you are using too old glibc headers with -std=gnu99, without fixincludes and without -fgnu89-inline. Only headers of glibc later than mid-2007 are prepared for -std=gnu99 with GCC 4.3 without fixincludes a

[Bug c/42440] optimization bug with btwowc(EOF) in wchar.h

2009-12-20 Thread pinskia at gcc dot gnu dot org
--- Comment #6 from pinskia at gcc dot gnu dot org 2009-12-21 00:32 --- (In reply to comment #4) > > Works for me. The preprocessed source is certainly not what was compiled > > Yes, it was. But I apologize, the invocation needs to include -std=gnu99 to > observe the problem, e.g., gc