[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#386864: [m68k] gcc-4.1 -O2 -fomit-frame-pointer generate wrong code

Package: gcc-4.1
Version: 4.1.1-13

Hello Debian GCC maintainers,

On m68k, gcc-4.1 miscompile the function darg in the file
src/basemath/trans2.c of the pari package version 2.3.0-2 when
using the following options:

gcc-4.1 -c -g -O2 -Wall -fomit-frame-pointer -fno-strict-aliasing -I. -I../src/headers -D_REENTRANT -fPIC -o trans2.o ../src/basemath/trans2.c

It works fine if we remove the -fomit-frame-pointer flag.

The miscompiled function is as follow:

/* arg(s+it) */
darg(double s, double t)
  double x;
  if (!t) return (s>0)? 0.: PI;
  if (!s) return (t>0)? PI/2: -PI/2;
  x = atan(t/s);
  return (s>0)? x
              : ((t>0)? x+PI : x-PI);

The program segfault when the function returns.
This happen during the test suite or when entering
psi(1) inside the gp calculator.

The preprocessed file is available at

Bill. <ballombe@debian.org>

Imagine a large red swirl here. 

Reply to: