public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "drh at sqlite dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/32575]  New: GCC 4.3.0 with -ftree-vrp miscompiles a single line of code in SQLite
Date: Sun, 01 Jul 2007 22:07:00 -0000	[thread overview]
Message-ID: <bug-32575-14787@http.gcc.gnu.org/bugzilla/> (raw)

A bug reported against SQLite appears to be a case of GCC 4.3.0
miscompiling a single line of code within SQLite.  The problem only
appears with -O2 or -Os.  The problem goes away if we add the
-fno-tree-vrp option.  The original bug report can be found at

   http://www.sqlite.org/cvstrac/tktview?tn=2469

The line of code that is miscompiled is found in the source file
named vdbe.c (version 1.635) on line 4309.

  4308  for(j=0; j<nRoot; j++){
  4309    aRoot[j] = pTos[-j].u.i;
  4310  }
  4311  aRoot[j] = 0;

By setting a breakpoint on line 4311 and examining the values
of aRoot[] one finds that all nRoot entries of aRoot[] are being
filled from pTos[0].u.i instead of being filled from pTos[0].u.i,
pTos[-1].u.i, pTos[-2].u.i, and so forth as the loop intends.

I will be happy to supply any additional debugging information
that might help in fixing this problem (such as vdbe.s files 
compiled both with and without -fno-tree-vrp).  I regret that 
I have so far been unable to replicate this problem in a small 
test program.


-- 
           Summary: GCC 4.3.0 with -ftree-vrp miscompiles a single line of
                    code in SQLite
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drh at sqlite dot org


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


             reply	other threads:[~2007-07-01 22:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-01 22:07 drh at sqlite dot org [this message]
2007-07-01 22:16 ` [Bug tree-optimization/32575] " pinskia at gcc dot gnu dot org
2007-07-01 22:52 ` [Bug c/32575] " drh at sqlite dot org
2007-07-01 23:01 ` [Bug c/32575] GCC 4.2.0 " pinskia at gcc dot gnu dot org
2007-07-22 11:43 ` drh at sqlite dot org
2007-08-28 14:55 ` [Bug c/32575] [4.2/4.3 regression] With " jakub at gcc dot gnu dot org
2007-08-28 15:16 ` jakub at gcc dot gnu dot org
2007-08-28 15:58 ` jakub at gcc dot gnu dot org
2007-09-05 11:50   ` Daniel Berlin
2007-08-30 21:19 ` [Bug middle-end/32575] " pinskia at gcc dot gnu dot org
2007-09-05  0:56 ` mmitchel at gcc dot gnu dot org
2007-09-05 11:51 ` dberlin at dberlin dot org
2007-09-07 14:14 ` rguenth at gcc dot gnu dot org
2007-09-10 18:39 ` [Bug tree-optimization/32575] " jakub at gcc dot gnu dot org
2007-10-09 19:30 ` mmitchel at gcc dot gnu dot org
2007-11-01 14:03 ` nickc at redhat dot com
2007-11-01 14:06 ` nickc at redhat dot com
2007-11-01 14:34 ` jakub at gcc dot gnu dot org
2007-11-01 14:57 ` nickc at redhat dot com
2007-11-01 15:05 ` rguenth at gcc dot gnu dot org
2007-11-08 12:54 ` jakub at gcc dot gnu dot org
2007-11-08 13:08 ` jakub at gcc dot gnu dot org
2007-11-08 13:12 ` [Bug tree-optimization/32575] [4.2 " jakub at gcc dot gnu dot org
2008-02-01 17:05 ` jsm28 at gcc dot gnu dot org
2008-05-19 20:30 ` jsm28 at gcc dot gnu dot org
2009-03-30 22:11 ` jsm28 at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-32575-14787@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).