[llvm-bugs] [Bug 25932] New: clang-3.8 crash with invalid? asm vector constraints

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 23 01:22:53 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25932

            Bug ID: 25932
           Summary: clang-3.8 crash with invalid? asm vector constraints
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: peter at cordes.ca
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15513
  --> https://llvm.org/bugs/attachment.cgi?id=15513&action=edit
preprocessed source, same as what's in the bug report.

While trying to guess at the right syntax for something, I crashed clang 3.7 on
godbolt (which recompiles every time you stop typing).  I boiled it down to a
fairly minimal testcase that still crashes clang 3.8~svn256236-1~exp1 (from
apt.llvm.org, on x86-64 Ubuntu 15.10).




//#include <immintrin.h>
typedef float __m512 __attribute__ ((vector_size (64)));

__m512 mul_broad(__m512 a, float b) {
    int j=0;
    asm(
    "vbroadcastss  %[scalar], %%zmm1\n\t"
    : [vec] "+Yt" (a), [scalar] "+x" (b)
    : [xv] "t" (j)
    :
    );
    return a;
}



I was trying to find the right syntax for something like `%z[scalar]` that
would expand to %zmm1 if the scalar was in %xmm1.  (Like %q[int_var] to get
%rax instead of %eax).  But that's not relevant to this bug report


compiler output:


$ clang-3.8 -O3 -Wall -march=haswell -mavx512f -fverbose-asm clang-crash.c
clang-crash.c:7:2: error: scalar-to-vector conversion failed, possible invalid
constraint for vector type
        "vbroadcastss  %[scalar], %%zmm1\n\t"
        ^
0  libLLVM-3.8.so.1 0x00007f43a369ad48
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 56
1  libLLVM-3.8.so.1 0x00007f43a3699106 llvm::sys::RunSignalHandlers() + 54
2  libLLVM-3.8.so.1 0x00007f43a3699269
3  libpthread.so.0  0x00007f43a1c39d10
4  libLLVM-3.8.so.1 0x00007f43a32e2134
Stack dump:
0.      Program arguments: /usr/lib/llvm-3.8/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-main-file-name clang-crash.
c -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu haswell
-target-feat
ure +avx512f -target-linker-version 2.25.1 -momit-leaf-frame-pointer
-dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0
 -internal-isystem /usr/local/include -internal-isystem
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -i
nternal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-Wall -fdebug-compilation-dir /home/peter/bug/clang -ferror-limit 19
-fmessage-length 1
63 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -o /tmp/clang-crash-26cb81.o -x c clang-crash.c
1.      <eof> parser at end of file
2.      Code generation  
3.      Running pass 'Function Pass Manager' on module 'clang-crash.c'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@mul_broad'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Ubuntu clang version 3.8.0-svn256236-1~exp1 (trunk) (based on LLVM 3.8.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin   
clang: note: diagnostic msg: PLEASE submit a bug report to
http://bugs.debian.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang: note: diagnostic msg:
********************

-- 
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/20151223/efd95635/attachment-0001.html>


More information about the llvm-bugs mailing list