This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
<none>
- To: egcs-bugs at cygnus dot com
- Subject: <none>
- From: Martin Blom <lcs at lysator dot liu dot se>
- Date: Sun, 2 Aug 1998 13:16:37 (+0100)
- Organization: Divine Software
Greetings, Sirs!
I'm using a RedHat 5.1/i386 setup, and I have problems compiling the
code below (with the optimizer turned on). I've tried both with the
"official" rpm's ( gcc-2.8.1-1, egcs-c++-1.0.2-8, egcs-1.0.2-8 ) from
RedHat (installed by default), and egcs-c++-1.0.3a-1 and
egcs-c++-1.0.3a-1 from <URL:ftp://ftp.sunet.se/pub/os/Linux/distributions/redhat/contrib/manhattan/i386>.
If you need more information, let me know.
------------------------------------------------------------------------
[lcs@therese libimage]$ c++ -lm -O2 test.cpp
test.cpp: In method `void Image::Rotate(double)':
test.cpp:40: Internal compiler error.
test.cpp:40: Please submit a full bug report to `egcs-bugs@cygnus.com'.
[lcs@therese libimage]$ c++ --version
egcs-2.90.29 980515 (egcs-1.0.3 release)
[lcs@therese libimage]$ uname --all
Linux therese.mediate 2.0.35 #1 Thu Jul 23 14:01:04 EDT 1998 i586
unknown
[lcs@therese libimage]$
------------------------------------------------------------------------
#include <math.h>
static const double PI = 3.14159265358979323846;
struct Pixel
{
unsigned char r; // Red
unsigned char g; // Green
unsigned char b; // Blue
unsigned char a; // Alpha
};
class TError;
class Image
{
public:
void Rotate( double degrees )
throw( TError );
int Width();
int Height();
Pixel BackgroundColor();
};
void
Image::Rotate( double degrees )
throw( TError )
{
Pixel bgcol = BackgroundColor();
double cosphi = cos( degrees * PI * 2 / 360 );
double sinphi = sin( degrees * PI * 2 / 360 );
int wdst = (int) floor( fabs( cosphi * Width() ) +
fabs( sinphi * Height() ) );
int hdst = (int) floor( fabs( cosphi * Height() ) +
fabs( sinphi * Width() ) );
/*
...
*/
}
--
---- Martin 'Leviticus' Blom ----------- lcs@lysator.liu.se ----
Eph 1:3-23 http://www.lysator.liu.se/~lcs/