This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12124] New: Comparison "greater" in if statement causes internal compiler error if compiler is used with optimizationi
- From: "hansjuergen dot dreuth at simplify-technologies dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Sep 2003 09:08:42 -0000
- Subject: [Bug c/12124] New: Comparison "greater" in if statement causes internal compiler error if compiler is used with optimizationi
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12124
Summary: Comparison "greater" in if statement causes internal
compiler error if compiler is used with optimizationi
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hansjuergen dot dreuth at simplify-technologies dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: h8300-hitachi-hms
This error occurs when using a GNU crosscompiler for the Hitachi microprocessors
(the compiler was used on an Intel P3/800MHz with Debian Linux 3.0 (Kernel
Version 2.4))
Version details: (output of the question about the version):
/usr/local/crossh8b/h8300-hms/bin/gcc -v
Reading specs from /usr/local/crossh8b/lib/gcc-lib/h8300-hms/3.3.1/specs
Configured with: ../gcc-3.3.1/configure --target=h8300-hms
--prefix=/usr/local/crossh8b --with-newlib --enable-target-optspace
--enable-languages=c -v
Thread model: single
gcc version 3.3.1
I have broken down the whole (originally larger file) to the place where the
error happens (see below). Error occurring with optimizing with -O2 or -O. This
error does not occur without -O2 or -O
Call of the compiler:
gcc -c -ggdb -mh -O2 -ansi -pedantic -Wall -W -Wno-main -Wmissing-declarations
-Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wstrict-prototypes
-Wmissing-declarations -Wredundant-decls -B
/usr/local/crossh8b/lib/gcc-lib/h8300-hms/3.3.1/ -B
/usr/local/crossh8b/h8300-hms/bin/ -I /usr/local/crossh8b/h8300-hms/include/ -c
-o twowire2.o twowire2.c
/tmp/ccaIo1kc.i:1:3: warning: style of line directive is a GCC extension
twowire2.c: In function `i2c_read_ack':
twowire2.c:26: internal compiler error: in final_scan_insn, at final.c:2767
Here is the code causing the error:
# 1 "twowire2.c"
typedef unsigned char err_code;
err_code i2c_read_ack( void);
err_code i2c_read_ack( void)
{
err_code err;
if( ((*(volatile unsigned char *) (0xFFFFFF52)) & 0x20 ) > 0)
{
err = 1;
}
else
{
err = 0;
}
return err;
}