http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57749
--- Comment #5 from Harald Anlauf <anlauf at gmx dot de> --- (In reply to Vittorio Zecca from comment #4) > I am happy to refresh my complex analysis study of long ago. > The singularity of log(x) in zero is not essential. Right. > Essential singularity means the Laurent seriesis infinite in both > directions? > z**-k and z**+k roughly, but log(z) Laurent series is infinite only for > z**+k. > I hope to remember correctly. > But exp(y*log(x)) may well be essential, however. Yes, since exp(z) has an essential singularity at complex infinity. > Anyway I am not sure this is an essential (forgive the pun) reason to raise > an exception So what should the correct result be? > Also I do not understand the different behaviour with different levels of > optimization, I think that compile-time optimization realizes that the exponent y is actually exactly a positive integer and does some simplification. At -O0, you get an evaluation by the run-time library. > and I confirm the a.out executable runs fine under valgrind. > And the code runs fine with Intel ifort. > And I really do not see how complex zero raised to a positive power should > raise an exception. Well, you actually provide a non-integer (real or complex) exponent, even if it is accidentally a positive integer.