public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40111]  New: "for" loop wrong code generation
@ 2009-05-12  9:36 face dot mitev at gmail dot com
  2009-05-12  9:51 ` [Bug c++/40111] " rguenth at gcc dot gnu dot org
  2009-05-12  9:54 ` face dot mitev at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: face dot mitev at gmail dot com @ 2009-05-12  9:36 UTC (permalink / raw)
  To: gcc-bugs

This for loop
for(unsigned i=object::min(_digits, (int)NATIVE_DIGITS);i<NATIVE_DIGITS;++i)
        inside_digit[i]=0;

generates the following incorrect code.
.L182:
        .loc 12 59 0
        movl    -8(%rbp), %eax
        movq    -24(%rbp), %rdx
        mov     %eax, %eax
        movq    $0, (%rdx,%rax,8)
        .loc 12 58 0
        addl    $1, -8(%rbp)
.L181:
        cmpl    $3, -8(%rbp)
        jbe     .L182
        jmp     .L183

This code always runs the body at least once, which, I think is incorrect.
I'm sorry I cannot include a simple test case to reproduce it, but it is very
hard to trigger and trying to isolate it just makes it go away.


-- 
           Summary: "for" loop wrong code generation
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: face dot mitev at gmail dot com
 GCC build triplet: x86_64 linux gnu
  GCC host triplet: x86_64 linux gnu
GCC target triplet: x86_64 linux gnu


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


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

* [Bug c++/40111] "for" loop wrong code generation
  2009-05-12  9:36 [Bug c++/40111] New: "for" loop wrong code generation face dot mitev at gmail dot com
@ 2009-05-12  9:51 ` rguenth at gcc dot gnu dot org
  2009-05-12  9:54 ` face dot mitev at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-12  9:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2009-05-12 09:51 -------
We need a testcase that is reproducible.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug c++/40111] "for" loop wrong code generation
  2009-05-12  9:36 [Bug c++/40111] New: "for" loop wrong code generation face dot mitev at gmail dot com
  2009-05-12  9:51 ` [Bug c++/40111] " rguenth at gcc dot gnu dot org
@ 2009-05-12  9:54 ` face dot mitev at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: face dot mitev at gmail dot com @ 2009-05-12  9:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from face dot mitev at gmail dot com  2009-05-12 09:54 -------
Not a gcc bug, sorry for the confusion.


-- 

face dot mitev at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2009-05-12  9:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12  9:36 [Bug c++/40111] New: "for" loop wrong code generation face dot mitev at gmail dot com
2009-05-12  9:51 ` [Bug c++/40111] " rguenth at gcc dot gnu dot org
2009-05-12  9:54 ` face dot mitev at gmail dot com

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).