Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7932 Discussions

icx error: wrong code at -O2/3 since `x86-64 icx-2023.2.0`

Junwei_Zeng
Beginner
540 Views

Hi,

I compiled the following code with icx at -O2/3, and it produces the wrong code. The correct output result should be 1, but 0 was output under -O2/3.
I found this bug was introduced starting from `x86-64 icx-2023.2.0`.
 

 

int printf(const char *, ...);
long a;
int *b;
static int **c = &b;
int d;
int *e = &d;
int main() {
  int ***f = &c, ***g = f;
  for (; a >= 0; a--) {
    int **h = &b;
    *h = e;
    for (;;) {
      *b = 0 == &g;
      ***f = 1;
      break;
    }
    **f = *h;
  }
  printf("%d\n", d);
}

 

The bug triggered by this test code may be similar to the one I submitted (here's the link: icx error: wrong code at -O3 since `x86-64 icx-2023.2.0` ). If it is the same, and the issue has been fixed in the new icx version, hopefully this test code will help enrich icx test suite.

Also, I was wondering if there is any way to submit test cases to the icx test suite, which I found triggers the icx compiler bugs (i.e. enriching icx test suite)?

 

Best regards,

Junwei Zeng.

Labels (1)
0 Kudos
1 Solution
VaishnaviV_Intel
Moderator
496 Views

Hi,

 

Thanks for posting on Intel communities.

The issue you reported has been addressed in the latest release of oneAPI, version 2024.0.0.

Kindly download it from the provided link:

https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html

We have successfully tested it on icx 2024.0.0, achieving the correct result of 1 with O2 and O3 optimizations. The output is as follows:

VaishnaviV_Intel_0-1700194976429.png

 

If you still have any issues, please let us know.

 

Thanks & Regards,

Vankudothu Vaishnavi.

 

View solution in original post

0 Kudos
4 Replies
VaishnaviV_Intel
Moderator
497 Views

Hi,

 

Thanks for posting on Intel communities.

The issue you reported has been addressed in the latest release of oneAPI, version 2024.0.0.

Kindly download it from the provided link:

https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html

We have successfully tested it on icx 2024.0.0, achieving the correct result of 1 with O2 and O3 optimizations. The output is as follows:

VaishnaviV_Intel_0-1700194976429.png

 

If you still have any issues, please let us know.

 

Thanks & Regards,

Vankudothu Vaishnavi.

 

0 Kudos
VaishnaviV_Intel
Moderator
429 Views

Hi,


We have not heard back from you.

Has the information provided above helped? If yes, could you please confirm whether we can close this thread from our end?


Thanks & Regards,

Vankudothu Vaishnavi.


0 Kudos
Junwei_Zeng
Beginner
418 Views

Hi,

 

Thank you for following up.

The information provided has been helpful, and I consider the issue resolved. You may go ahead and close this thread from your end.

 

Thanks & Regards,

Junwei Zeng.

0 Kudos
VaishnaviV_Intel
Moderator
392 Views

Hi,


Thanks for the confirmation. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel. 


Thanks & Regards,

Vankudothu Vaishnavi.


0 Kudos
Reply