[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 09:15:30 CDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7449

           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
trunk. 
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);
        pollKeyboard(seek_sndfile);
  }
  return;
}

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 LLVMbugs mailing list