Question about why GCC produces the wrong-code bug

2022-09-17 Thread Haoxin Tu via Gcc
Dear developers, May I seek your help with some understanding of why GCC produces the wrong-code bug? I understand that such a bug can only be reproduced in an old GCC version, but I still want to know why GCC made mistake here. The bug-revealing code makes GCC-4.7.0 produce miscompiled code unde

Re: Possible wrong-code bug in GCC?

2022-08-01 Thread Haoxin Tu via Gcc
Oh, sorry for the noise, there is an integer overflow that may cause undefined behavior. Haoxin Tu 于2022年8月2日周二 11:23写道: > Dear developers, > > May I seek your confirmation to check whether the following program > triggers a true wrong-code issue in GCC? The following piece of code looks > too s

Possible wrong-code bug in GCC?

2022-08-01 Thread Haoxin Tu via Gcc
Dear developers, May I seek your confirmation to check whether the following program triggers a true wrong-code issue in GCC? The following piece of code looks too simple and I am not quite sure whether it's a bug or not. Here is the test program (s.c): ``` int a = 0, b = 0; int main() { for (; a

Re: Is this a possible wrong-code issue?

2022-03-11 Thread Haoxin Tu via Gcc
Hi Andrew, I see. Thanks for your speedy reply for clearing my confusion! Have a great day! Best regards, Haoxin Andrew Pinski 于2022年3月12日周六 12:33写道: > On Fri, Mar 11, 2022 at 8:21 PM Haoxin Tu via Gcc wrote: > > > > Dear developers, > > > > May I seek your confir

Is this a possible wrong-code issue?

2022-03-11 Thread Haoxin Tu via Gcc
Dear developers, May I seek your confirmation to check whether the following program triggers a true wrong-code issue or not? I don't want to make noise to the bug repository so I'd like to seek your confirmation here first. The following case makes GCC outputs differ under -O1 below vs -O1 abov

Is this program well-defined?

2021-11-13 Thread Haoxin Tu via Gcc
Hi all. I hope this is the right place to ask the question. I found a test case that makes almost all (GCC-5.1 above) versions (may) produce the wrong code at -Os. So, I am confused here whether this test case is well-defined or not. Here is the program (small.c): ``` #include #include int16_

Re: How to deal with the different result when executing UB programs?

2020-05-21 Thread Haoxin Tu via Gcc
Ok, thanks. Jonathan Wakely 于2020年5月22日 周五14:21写道: > On Fri, 22 May 2020 at 06:54, Haoxin Tu via Gcc wrote: > > > > Hi, there! > > > > I am new for using GCC mail list, please forgive me if something is > wrong. > > You're using the wrong mailing list, s

How to deal with the different result when executing UB programs?

2020-05-21 Thread Haoxin Tu via Gcc
Hi, there! I am new for using GCC mail list, please forgive me if something is wrong. I have some issues about how GCC deal with the different optimizations in a UB program. For example, small.cc *#include unsigned long long a;void b(unsigned long long *c, int h) { *c = h; }int d = 0;in