This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/37665] New: invalid loop generation
- From: "joel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Sep 2008 20:59:41 -0000
- Subject: [Bug c/37665] New: invalid loop generation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
At optimization levels -Os, -O1, and -O2, the attached program generates
incorrect loop code. It appears that when optimizing, the loop termination is
checking array end address versus current pointer. The array end address
contains all address bits while the current pointer is just the lower (16?)
bits.
m32c-elf-gcc -O1 -mcpu=m32cm -msim m1.c && m32c-elf-run a.out
NULL pointer dereference
Attaching test program.
--
Summary: invalid loop generation
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: joel at gcc dot gnu dot org
GCC target triplet: m32c-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37665