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

floating point exception

Richard_D_2
Beginner
557 Views

The attached very simple program crashed when compiled with icc (icc version 15.0.2 (gcc version 4.9.0 compatibility)), under Ubuntu 14.10.

Step to reproduce

  1. Download the attached source file bug.c
  2. Compile it: icc bug.c -o bug
  3. Execute it: bug
  4. Result:

0 1 -> 1
Floating point exception (core dumped)

When compiled with other compilers as gcc or clang, the program behaves as expected, without crashing. The source code does not contain any floating point variable.

--

Richard Delorme

 

 

 

 

0 Kudos
3 Replies
pbkenned1
Employee
557 Views

Thank you for reporting the issue.  It appears to be an -O2 (or higher) optimization bug (-O0/-O1 work fine).  We'll investigate and follow up.

Patrick

0 Kudos
pbkenned1
Employee
557 Views

This has been reported to the developers, internal tracking ID DPD200366334.  I'll keep this thread updated with any news.

Patrick

0 Kudos
pbkenned1
Employee
557 Views

This issue is fixed in PSXE 2016 update #1, so I'm closing this ticket now. 

Patrick

C:\ISN_Forums\U540788>icl -O2 bug.c
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.1.146 Build 20151021
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

bug.c
Microsoft (R) Incremental Linker Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:bug.exe
bug.obj

C:\ISN_Forums\U540788>bug.exe

0 1 -> 1
0 2 -> 1
0 3 -> 1
0 4 -> 1
0 5 -> 1
0 6 -> 1
0 7 -> 1
0 8 -> 8
0 16 -> 8
0 24 -> 8
0 32 -> 8
0 40 -> 8
0 48 -> 8
0 56 -> 8
0 9 -> 9
0 18 -> 9
0 27 -> 9
0 36 -> 9
0 45 -> 9
0 54 -> 9
0 63 -> 9

[SNIP]

63 62 -> 1
63 61 -> 1
63 60 -> 1
63 59 -> 1
63 58 -> 1
63 57 -> 1
63 56 -> 1
done

C:\ISN_Forums\U540788>

0 Kudos
Reply