[LLVMbugs] [Bug 19763] New: Inline asm with constraint 'i' fails with --fsanitize=undefined

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 16 06:17:55 PDT 2014


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

            Bug ID: 19763
           Summary: Inline asm with constraint 'i' fails with
                    --fsanitize=undefined
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kdev at fishzet.co.uk
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12517
  --> http://llvm.org/bugs/attachment.cgi?id=12517&action=edit
Preprocessed source code from Libav which triggers the bug (3x)

% cat min.i
fn1() { __asm__("" ::"r"(0), "i"(0 * 0)); }

% clang -fsanitize=undefined -c -o obj.o min.i 2>&1 | grep -A 2 error
dsputil_mmx.i:1:17: error: invalid operand for inline asm constraint 'i'
fn1() { __asm__("" ::"r"(0), "i"(0 * 0)); }

Without -fsanitize=undefined, the above code compiles. The above code is
generated with creduce from the attached file (dsputil_mmx.i) and the following
creduce script:

% cat bug683libav.sh 
#!/bin/bash
rm -f out.txt *.o
ulimit -t 1

if
    clang -c -o good.o dsputil_mmx.i &&\
    ! clang -fsanitize=undefined -c -o no.o dsputil_mmx.i > out.txt 2>&1 &&\
    grep "invalid operand for inline asm constraint" out.txt
then exit 0
else exit 1
fi

References:
https://bugzilla.libav.org/show_bug.cgi?id=683 (the original Libav bug)
http://git.videolan.org/?p=ffmpeg.git;a=blobdiff;f=libavcodec/x86/dsputil_mmx.c;h=86100ba6ff86e9c6791364b3b4b00be1fea03b41;hp=c574458a20639d90567627e99d105bd20d5d570f;hb=bebce653e5601ceafa004db0eb6b2c7d4d16f0c0;hpb=d1310c591eb24202ecc28af4adb28cce690109e5
(the FFmpeg workaround).

% clang --version
Ubuntu clang version 3.5-1ubuntu1 (trunk) (based on LLVM 3.5)
Target: x86_64-pc-linux-gnu
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140516/5bed173f/attachment.html>


More information about the llvm-bugs mailing list