It was a bug. I already corrected. It was an array with bad dimensions.It was like: int a[2]; a[2]=1; ****************** Corrected to: int a[3]; ******************** I updated the post in the Intel Forum. Sorry. Thanks. Luís Gonçalves On 09/08/2023 15:50, Paul Smith wrote:On Wed, 2023-08-09 at 11:14 +0200, Luís Carlos Carneiro Gonçalves via Gcc wrote:Without -O3 and -O2 the OpenCL gave consistently good results without returning any error. I think my code is Ok but I open to criticism.By "has a bug" we don't necessarily mean something that is obviously wrong and fails every time like trying to dereference a null pointer. We mean, you are making an assumption about how the compiler will compile your code, that is not guaranteed by the standard. Because it's not guaranteed, when you enable optimizations the compiler is free to rearrange things in ways you maybe don't expect, but are allowed by the language definition.If you are open to help me I can send all the sources.I doubt anyone here has the time or energy to read and debug "all the sources" for you. If you reduce your code to a small example that shows the error, then post that to the correct mailing list as Jonathan suggested. Then someone may be able to point out your mistake. Or, maybe it really is a bug in the optimizer. Such things are very rare but have been known to happen. In my long experience as a programmer, however, "the compiler has a bug" has NEVER been a winning bet.
Re: Please see the following post. Some of you may know the answer.
Luís Carlos Carneiro Gonçalves via Gcc Wed, 09 Aug 2023 06:56:53 -0700
- Please see the following post. So... Luís Carlos Carneiro Gonçalves via Gcc
- Re: Please see the following... Jonathan Wakely via Gcc
- Re: Please see the follo... Luís Carlos Carneiro Gonçalves via Gcc
- Re: Please see the f... Paul Smith
- Re: Please see t... Luís Carlos Carneiro Gonçalves via Gcc