This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: <none>
- To: Martin Blom <lcs at lysator dot liu dot se>
- Subject: Re: <none>
- From: Bjoern Wennberg <bjornw at fairplay dot no>
- Date: Tue, 04 Aug 1998 15:58:28 +0000
- CC: egcs-bugs at cygnus dot com
- Organization: FairPlay International AS
- References: <19980802.79EA1C0.C1EA@lcsgate.rydnet.lysator.liu.se>
I had no problems compiling this code with the egcs-19980727 snapshot.
I'm running redhat-5.1.
bjornw>
Martin Blom wrote:
> 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/
--
-------------------------------------------------------
Bjorn Wennberg email: bjornw@fairplay.no
ms: +47 950 82 657
Senior Programmer phone: +47 22405538
FairPlay International AS fax: +47 22405539