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

Bug in exp()?

SomeScientist
Beginner
411 Views

Hello again, 

as my last post went by unnoticed, I chose to restate my question. While analyzing Intel-compiled code, I stumbled upon an interesting code snippet I cannot find another explanation than a potential bug. I wrote the following test program:

#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{

   if(argc < 2) {
      printf("argument for exp() is needed\n");
      printf("call %s <the xth power>\n", *argv);
      return EXIT_FAILURE;
   }

   double power = atof(argv[1]);
   double result = exp(power);

   printf("The exponential value of %lf is %lf\n", power, result);

   return EXIT_SUCCESS;
}

The code was compiled with "-O1 -g". Here, we could further pinpoint the original error. The culprit is found in libimf.a. If you extract it, you can find the file exp_wmt.o, having the public function exp.J (exp_J). I'll post again some instructions of the erroneous basic block:

.text:080001C2 jmp     loc_80002EB
.text:080001C7 ; ---------------------------------------------------------------------------
.text:080001C7 cmp     ecx, 80000000h <-- never executed
.text:080001CD jb      short loc_80001F2
.text:080001CF cmp     ecx, 0C086232Bh

 

As the code resides in a static library, I doubt it is subject to further compiler optimizations. I think this is a bug.

Thanks for your help, 

Sebastian

0 Kudos
3 Replies
Marián__VooDooMan__M
New Contributor II
411 Views

Greetings,

This is really, really, really, SERIOUS problem. It is worth for me, since my SW is mathematically-based.

Do you have informations about on which platform is the problem?

PS: to Intel: PIING? no one so far responded in nearly one week! And this is really serious problem! Should had the highest priority.

0 Kudos
SomeScientist
Beginner
411 Views

Hi Marián, 

thanks for your message. So far, I have discovered the problem for the 32 bit version of the Linux version, but I haven't looked at the other compilers. I will soon check the other versions (Linux 64 bit and Windows 32/64 bits) and keep you up to date.

0 Kudos
TimP
Honored Contributor III
411 Views

There were 5 replies the first time "somescientist" posted this question, 2 of them from a current Intel employee.  Neither of you have explained how this question is serious for you, or what could be meant by "unnoticed."

If the question actually is important, you could file it on premier.intel.com, or, if the site doesn't work, file a report about that.

0 Kudos
Reply