This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53239] New: [4.7 Regression] -ftree-vrp breaks min()


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

             Bug #: 53239
           Summary: [4.7 Regression] -ftree-vrp breaks min()
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: proski@gnu.org


GNU Lilypond is miscompiled on Fedora 17.  It manifests as a failure to process
any non-trivial input.  Both i386 and x86_64 are affected.

$ gcc --version
gcc (GCC) 4.7.0 20120502 (Red Hat 4.7.0-3)

It turns out that adding -fno-tree-vrp fixes the problem.  A call to min() is
affected.  Comparing the assembly output without and with -fno-tree-vrp shows
that the generated assembly code wrongly eliminates a conditional register move
after calling the compare (_ZN6Moment7compareERKS_S1_) function.

The attached file was generated on i386.

Credit for finding a problem in the assembly goes to David Kastrup.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]