[Bug c/29592] Unending loops

2006-10-25 Thread darkjames at darkjames dot ath dot cx
--- Comment #1 from darkjames at darkjames dot ath dot cx 2006-10-25 16:12 --- Created an attachment (id=12490) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12490action=view) First testcase First testcase loops unending with -O2, not loops with -O2 -fno-strict-aliasing ||

[Bug c/29592] Unending loops

2006-10-25 Thread darkjames at darkjames dot ath dot cx
--- Comment #2 from darkjames at darkjames dot ath dot cx 2006-10-25 16:13 --- Created an attachment (id=12491) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12491action=view) Second testcase test1.c + added printf() to loop, not loops with -O2 --

[Bug c/29592] Unending loops

2006-10-25 Thread darkjames at darkjames dot ath dot cx
--- Comment #3 from darkjames at darkjames dot ath dot cx 2006-10-25 16:20 --- By the way, it's possible to fix the code in other way than using unions? It just need to work both for wchar_t strings and normal strings... If you have some ideas how, it'll be nice if you give me some

[Bug c/29592] Unending loops

2006-10-25 Thread pinskia at gcc dot gnu dot org
--- Comment #4 from pinskia at gcc dot gnu dot org 2006-10-25 16:45 --- In the both case, you are accessing wchar * via char * which causes an alias violation. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added

[Bug c/29592] Unending loops

2006-10-25 Thread darkjames at darkjames dot ath dot cx
--- Comment #5 from darkjames at darkjames dot ath dot cx 2006-10-25 17:11 --- Yeah, I know, but why gcc generate good code if we add that printf to test1.c (test2.c) ? It's still wchar * - char * still aliasing violation. or if we replace: __SN(str, 1); with str = (CHAR_T *) (((char

[Bug c/29592] Unending loops

2006-10-25 Thread pinskia at gcc dot gnu dot org
--- Comment #6 from pinskia at gcc dot gnu dot org 2006-10-25 17:18 --- (In reply to comment #5) Yeah, I know, but why gcc generate good code if we add that printf to test1.c (test2.c) ? It's still wchar * - char * still aliasing violation. Yes but there is a barrier which cause

[Bug c/29592] Unending loops

2006-10-25 Thread darkjames at darkjames dot ath dot cx
--- Comment #7 from darkjames at darkjames dot ath dot cx 2006-10-25 17:24 --- Ok, one more question, is it possible to gcc print some warnings about code like that? Cause even with -Wall it doesn't ;( gcc4 is quite more verbose than gcc3 so I think It'll be better to print warning