Re: issue: unexpected results in optimizations

2023-12-14 Thread James K. Lowden
On Tue, 12 Dec 2023 09:39:58 +0100 David Brown via Gcc wrote: > If you have fixed the immediate problems in the code, add the > "-fsanitize=undefined" flag before running it. That will do run-time > undefined behaviour checks. I would like to understand that better, for reasons you might gues

Re: issue: unexpected results in optimizations

2023-12-12 Thread Alexander Monakov via Gcc
On Tue, 12 Dec 2023, Jonathan Wakely via Gcc wrote: > On Mon, 11 Dec 2023, 17:08 Jingwen Wu via Gcc, wrote: > > > Hello, I'm sorry to bother you. And I have some gcc compiler optimization > > questions to ask you. > > First of all, I used csmith tools to generate c files randomly. Meanwhile, >

Re: issue: unexpected results in optimizations

2023-12-12 Thread Jonathan Wakely via Gcc
On Mon, 11 Dec 2023, 17:08 Jingwen Wu via Gcc, wrote: > Hello, I'm sorry to bother you. And I have some gcc compiler optimization > questions to ask you. > First of all, I used csmith tools to generate c files randomly. Meanwhile, > the final running result was the checksum for global variables i

Re: issue: unexpected results in optimizations

2023-12-12 Thread David Brown via Gcc
Hi, First, please ignore everything Dave Blanchard writes. I don't know why, but he likes to post angry, rude and unhelpful messages to this list. Secondly, this is the wrong list. gcc-help would be the correct list, as you are asking for help with gcc. This list is for discussions on the

Re: issue: unexpected results in optimizations

2023-12-12 Thread Jonathan Wakely via Gcc
Ignore the troll On Mon, 11 Dec 2023, 17:28 Dave Blanchard, wrote: > Hi Jingwen, > > This is the same GCC which in recent versions produces something like two > dozen extraneous, useless, no-op instructions when doing a simple 64-bit > math operation on 32-bit systems, and does not use SSE prope

Re: issue: unexpected results in optimizations

2023-12-11 Thread Dave Blanchard
Hi Jingwen, This is the same GCC which in recent versions produces something like two dozen extraneous, useless, no-op instructions when doing a simple 64-bit math operation on 32-bit systems, and does not use SSE properly either. In each major release these problems get worse. The code generat

issue: unexpected results in optimizations

2023-12-11 Thread Jingwen Wu via Gcc
Hello, I'm sorry to bother you. And I have some gcc compiler optimization questions to ask you. First of all, I used csmith tools to generate c files randomly. Meanwhile, the final running result was the checksum for global variables in a c file. For the two c files in the attachment, I performed t

issue: unexpected results in optimizations

2023-12-11 Thread Jingwen Wu via Gcc
Hello, I'm sorry to bother you. And I have some gcc compiler optimization questions to ask you. First of all, I used csmith tools to generate c files randomly. Meanwhile, the final running result was the checksum for global variables in a c file. For the two c files in the attachment, I performed t

issue: unexpected results in optimizations

2023-12-11 Thread Jingwen Wu via Gcc
Hello, I'm sorry to bother you. And I have some gcc compiler optimization questions to ask you. First of all, I used csmith tools to generate c files randomly. Meanwhile, the final running result was the checksum for global variables in a c file. For the two c files in the attachment, I performed t

issue: unexpected results in optimizations

2023-12-11 Thread Jingwen Wu via Gcc
Hello, I'm sorry to bother you. And I have some gcc compiler optimization questions to ask you. First of all, I used csmith tools to generate c files randomly. Meanwhile, the final running result is the checksum for global variables in a c file. For the two c files in the attachment, I performed th