public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/39233]  New: [4.4 Regression] ivopts + vrp miscompilation
@ 2009-02-18 17:05 jakub at gcc dot gnu dot org
  2009-02-18 17:05 ` [Bug tree-optimization/39233] " jakub at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-02-18 17:05 UTC (permalink / raw)
  To: gcc-bugs

extern void abort (void);

__attribute__((noinline)) void
foo (void *p)
{
  long l = (long) p;
  if (l < 0 || l > 6)
    abort ();
}

int
main ()
{
  int i;
  for (i = 6; i >= 0; i--)
    foo ((void *) (long) i);
  return 0;
}

is miscompiled (into endless loop).  First ivopts decides to use a pointer IV,
going from (void *) 6 down, with (void *) ivtmp.51 != (void *) -1 as loop
condition, then VRP comes in and as pointers can never wrap around, optimizes
the loop condition into 1.


-- 
           Summary: [4.4 Regression] ivopts + vrp miscompilation
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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


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

end of thread, other threads:[~2009-02-24 11:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-18 17:05 [Bug tree-optimization/39233] New: [4.4 Regression] ivopts + vrp miscompilation jakub at gcc dot gnu dot org
2009-02-18 17:05 ` [Bug tree-optimization/39233] " jakub at gcc dot gnu dot org
2009-02-18 17:24 ` jakub at gcc dot gnu dot org
2009-02-18 17:47 ` rguenth at gcc dot gnu dot org
2009-02-18 17:51 ` rguenth at gcc dot gnu dot org
2009-02-18 17:53 ` rguenth at gcc dot gnu dot org
2009-02-18 18:47 ` rguenth at gcc dot gnu dot org
2009-02-18 18:56 ` jakub at gcc dot gnu dot org
2009-02-18 19:56 ` rguenth at gcc dot gnu dot org
2009-02-21 13:08 ` rguenth at gcc dot gnu dot org
2009-02-24 11:05 ` rguenth at gcc dot gnu dot org
2009-02-24 11:05 ` rguenth 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).