public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/37665]  New: invalid loop generation
@ 2008-09-27 21:01 joel at gcc dot gnu dot org
  2008-09-27 21:02 ` [Bug c/37665] " joel at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: joel at gcc dot gnu dot org @ 2008-09-27 21:01 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/37665] invalid loop generation
  2008-09-27 21:01 [Bug c/37665] New: invalid loop generation joel at gcc dot gnu dot org
@ 2008-09-27 21:02 ` joel at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: joel at gcc dot gnu dot org @ 2008-09-27 21:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from joel at gcc dot gnu dot org  2008-09-27 21:00 -------
Created an attachment (id=16417)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16417&action=view)
small test program

test program demonstrating problem


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37665


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-27 21:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-27 21:01 [Bug c/37665] New: invalid loop generation joel at gcc dot gnu dot org
2008-09-27 21:02 ` [Bug c/37665] " joel at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).