public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/28727]  New: Wrong code generated (assignment incorrectly optimized out)
@ 2006-08-14 18:58 qrczak at knm dot org dot pl
  2006-08-14 19:00 ` [Bug c/28727] " qrczak at knm dot org dot pl
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: qrczak at knm dot org dot pl @ 2006-08-14 18:58 UTC (permalink / raw)
  To: gcc-bugs

The attached module, when compiled with -O2, has wrong code generated for the
last set_global_field call. The assembly shows:

        leal    4(%edx), %eax
        cmpl    marked_limit, %eax
        movl    BadArguments, %ecx
        movl    $record_12420+4, (%edx)
        movl    %eax, marked_top
        jbe     .L28
        movl    %ecx, record_12420+4
        call    gc
.L28:
        leave
        xorl    %eax, %eax
        ret

while the assignment of BadArguments (from %ecx) to record_12420+4 should be
performed unconditionally, as can be easily deduced from the source.

This is gcc-4.2.0-0.20060806r115974. The bug doesn't manifest without -O2 or
when the number of set_global_field calls is reduced.


-- 
           Summary: Wrong code generated (assignment incorrectly optimized
                    out)
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: qrczak at knm dot org dot pl
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2006-08-26 20:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-14 18:58 [Bug c/28727] New: Wrong code generated (assignment incorrectly optimized out) qrczak at knm dot org dot pl
2006-08-14 19:00 ` [Bug c/28727] " qrczak at knm dot org dot pl
2006-08-14 19:11 ` [Bug middle-end/28727] " pinskia at gcc dot gnu dot org
2006-08-26 19:15 ` qrczak at knm dot org dot pl
2006-08-26 20:46 ` pinskia 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).