[LLVMbugs] [Bug 7449] New: A clang/llvm miscompile under Linux/x86_64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 22 07:15:30 PDT 2010


           Summary: A clang/llvm miscompile under Linux/x86_64
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: cesium2 at gmail.com
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=5087)
 --> (http://llvm.org/bugs/attachment.cgi?id=5087)
A tarball which is miscompiled under clang/llvm trunk

The attached tarball contains a program which miscompiles under clang/llvm
Play a long music file, speed up with '+', and it will crash long before it
reaches 500%.

I've been able to reduce the miscompile to the following loop (which I've
placed in yatm3.cc in the attached tarball):

void miscompiled_loop ()
  float buf[512 * sfinfo.channels];
  sf_count_t nFrames;

  while ((nFrames = sf_readf_float(sndfile, buf, 512)) > 0) {
        SAMPLETYPE samples[nFrames * sfinfo.channels];
        int i;
        for (i=0; i<nFrames*sfinfo.channels; i++) {
          samples[i] = buf[i]*32700.0;
        st->putSamples(samples, nFrames);
        //play_ao(sfinfo.channels, nFrames);

It is telling that clang/llvm only makes a 4.7K object file out of this, while
g++ 4.4 is almost double the size (8.3K).

The program can be compiled with "make" (you may have to edit Makefile for
clang path), or "make gcc" (for working gcc example). It requires SoundTouch
and sndfile libraries to be installed. I suspect a more knowledgeable person
than myself can reduce the testcase much further...

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list