Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why does cpow() cause SEGV when using optimzation >xO0 (Studio 12.3 x86)

jelmdSep 15 2014 — edited Sep 16 2014

#include <stdio.h>

#include <complex.h>

void bla(void);

#pragma opt 0 (bla,cpow)

void

bla() {

  double complex x = 0 + 1*I;

  double complex y = 0 + 1*I;

  double complex z;

  fprintf(stdout, "x={%E,%E} y={%E,%E}\n", x, y );

  z = cpow(x,y);

  fprintf(stdout, "z={%E,%E}\n", z);

}

int

main(int argc, char **argv) {

  bla();

}

Try e.g. with 'cc -xO0 pow.c -lm' and 'cc -xmaxopt -xO5 pow.c -lm'

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 14 2014
Added on Sep 15 2014
2 comments
643 views