public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/54014] New: Value Range propagation bug
@ 2012-07-18 11:40 ferrandi at elet dot polimi.it
  2012-07-18 11:44 ` [Bug tree-optimization/54014] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ferrandi at elet dot polimi.it @ 2012-07-18 11:40 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54014
           Summary: Value Range propagation bug
    Classification: Unclassified
           Product: gcc
           Version: 4.5.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ferrandi@elet.polimi.it


Created attachment 27822
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27822
sightly modified version of arith-rand.c

Dears,

I've found a problem with a sightly modified version of a gcc regression test
(arith-rand.c).
The regression test has been modified in order to abort on a specific
condition. The test correctly aborts when no optimization is performed but it
does not fail when -O2 is passed. The problem seems to be in how the VRP work,
in fact once the -fno-tree-vrp is passed the test correctly fails.

The line I've added to arith-rand.c is the following

if((unsigned int) ABS (yy)==2147483648u) abort();

The VRP claims that (unsigned int) ABS (yy) is in the range [1, 2147483647] but
the actual range should be [1, 2147483648]. Everything seems to be related to
the managing of -(-2147483648).

The test does not abort on these versions on gcc-4.5.3 (Ubuntu 12.04), 4.6.3
(Ubuntu 12.04) and on gcc-4.7.1 (debian wheezy/sid) with the following command
line:

gcc-4.5 arith-rand.c   -O2 #(Ubuntu 12.04)
gcc-4.5 arith-rand.c   -O2 #(Ubuntu 12.04)
gcc-4.7 arith-rand.c  -O2 #(debian wheezy/sid)

while it correctly aborts once the option -fno-tree-vrp is passed

Cheers,

Fabrizio


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

end of thread, other threads:[~2012-07-19  9:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18 11:40 [Bug tree-optimization/54014] New: Value Range propagation bug ferrandi at elet dot polimi.it
2012-07-18 11:44 ` [Bug tree-optimization/54014] " rguenth at gcc dot gnu.org
2012-07-18 11:56 ` ferrandi at elet dot polimi.it
2012-07-18 12:21 ` rguenth at gcc dot gnu.org
2012-07-18 17:42 ` ferrandi at elet dot polimi.it
2012-07-19  7:50 ` jakub at gcc dot gnu.org
2012-07-19  9:11 ` ferrandi at elet dot polimi.it

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