- To: submit@bugs.debian.org
- Subject: Bug#33786: egcs optimization error
- From: Juergen Kreileder <kreilede@issan.cs.uni-dortmund.de>
- Date: 24 Feb 1999 04:04:13 +0100
- Organization: CS Department, University of Dortmund, Germany
- Orignal-Sender: kreilede@sunshine.cs.uni-dortmund.de
- Reply-To: Juergen Kreileder <kreilede@issan.cs.uni-dortmund.de>, 33786@bugs.debian.org
- Resent-CC: Debian EGCS maintainers <egcs@packages.debian.org>
- Resent-To: debian-bugs-dist@lists.debian.org
Package: egcc
Version: 2.91.61-1
$ cat funny.c
#include <unistd.h>
#include <stdio.h>
#include <libio.h>
int main(int argc, char** argv)
{
int i = 0x80000000;
int j;
int k;
j = i / -1;
k = i % -1;
fprintf(stdout,"i is %d\n",i);
fprintf(stdout,"i / -1 = %d\n",j);
fprintf(stdout,"i %% -1 is %d\n",k);
}
$ egcc -O0 -o funnyO0 funny.c
Ok!
$ ./funnyO0
i is -2147483648
i / -1 = -2147483648
i % -1 is 0
Ok too.
$ egcc -O1 -o funnyO1 funny.c
../../gcc/toplev.c:2272: Internal compiler error in function float_signal
$ egcc -O2 -o funnyO2 funny.c
../../gcc/toplev.c:2272: Internal compiler error in function float_signal
$ egcc -O3 -o funnyO3 funny.c
../../gcc/toplev.c:2272: Internal compiler error in function float_signal
and so on.
The same occurs with egcs 1.1.1 (egcs_2.91.60-5).
Juergen
--
Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V
Baroper Strasse 301, D-44221 Dortmund, Germany
Phone: ++49 231/755-5806, Fax: ++49 231/755-5802