[llvm-bugs] [Bug 34605] New: [m32][skx] clang fails differently on X86 DAG->DAG Instruction Selection

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 14 09:50:23 PDT 2017


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

            Bug ID: 34605
           Summary: [m32][skx] clang fails differently on X86 DAG->DAG
                    Instruction Selection
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: ilia.taraban at intel.com
                CC: llvm-bugs at lists.llvm.org

This test fails differently(runfail with Illigal instruction, Segm.fault on
compilation) on skx, O2, m32

================= supernice.c ==============
char a[512];
int main (void)
{
    #ifdef RUNFAIL
    int i;
    for (i = 0; i < 512; i++)
      fill(a,  i, 512 - 1);
    #endif
    return 0;
}
void fill (char * const s,  int p, int len)
{
    int i;
    for (i = 0; i < 512; i++)
      #ifndef RUNFAIL
      if (i){
      #else
      if (i == len){
      #endif
          s[i] =  0;
      } else {
          #ifdef ILLEGAL
          s[i] = (i == p);
          #else
          s[i] = 0;
          #endif
      }
}
============================================

>>> clang -v
clang version 6.0.0 (trunk 313257)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...

>>> clang -m32 -march=skx -O2 -o supernice.exe supernice.c
>>> sde -skx -- ./supernice.exe
>>>

>>> clang -m32 -march=skx -O2 -o supernice.exe supernice.c -DRUNFAIL -DILLEGAL
>>> sde -skx -- ./supernice.exe
Illegal instruction (core dumped)

>>> clang -m32 -march=skx -O2  -o supernice.exe supernice.c -DILLEGAL
#0 0x0000000001d79b5a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(.../build/bin/clang-6.0+0x1d79b5a)
#1 0x0000000001d77e2e llvm::sys::RunSignalHandlers()
(.../build/bin/clang-6.0+0x1d77e2e)
#2 0x0000000001d77f6a SignalHandler(int) (.../build/bin/clang-6.0+0x1d77f6a)
#3 0x00007fb3eb4535e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#4 0x00000000012cf137
llvm::X86GenRegisterInfo::getSubClassWithSubReg(llvm::TargetRegisterClass
const*, unsigned int) const (.../build/bin/clang-6.0+0x12cf137)
#5 0x000000000250fa54 llvm::InstrEmitter::EmitSubregNode(llvm::SDNode*,
llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>,
llvm::detail::DenseMapPair<llvm::SDValue, unsigned int> >&, bool, bool)
(.../build/bin/clang-6.0+0x250fa54)
#6 0x0000000002512582 llvm::InstrEmitter::EmitMachineNode(llvm::SDNode*, bool,
bool, llvm::DenseMap<llvm::SDValue, unsigned int,
llvm::DenseMapInfo<llvm::SDValue>, llvm::detail::DenseMapPair<llvm::SDValue,
unsigned int> >&) (.../build/bin/clang-6.0+0x2512582)
#7 0x000000000250a849
llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::MachineInstrBundleIterator<llvm::MachineInstr,
false>&) (.../build/bin/clang-6.0+0x250a849)
#8 0x000000000249eccf llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(.../build/bin/clang-6.0+0x249eccf)
#9 0x00000000024a651a
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(.../build/bin/clang-6.0+0x24a651a)
#10 0x00000000024a8a33
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone
.part.960] (.../build/bin/clang-6.0+0x24a8a33)
#11 0x000000000131d364 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(.../build/bin/clang-6.0+0x131d364)
#12 0x00000000016e9b27
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(.../build/bin/clang-6.0+0x16e9b27)
#13 0x000000000196128a llvm::FPPassManager::runOnFunction(llvm::Function&)
(.../build/bin/clang-6.0+0x196128a)
#14 0x0000000001961323 llvm::FPPassManager::runOnModule(llvm::Module&)
(.../build/bin/clang-6.0+0x1961323)
#15 0x0000000001961c70 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(.../build/bin/clang-6.0+0x1961c70)
#16 0x0000000001ef2c88 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(.../build/bin/clang-6.0+0x1ef2c88)
#17 0x0000000001ef4676 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(.../build/bin/clang-6.0+0x1ef4676)
#18 0x000000000254ce26
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(.../build/bin/clang-6.0+0x254ce26)
#19 0x00000000028d84b2 clang::ParseAST(clang::Sema&, bool, bool)
(.../build/bin/clang-6.0+0x28d84b2)
#20 0x000000000254c6b4 clang::CodeGenAction::ExecuteAction()
(.../build/bin/clang-6.0+0x254c6b4)
#21 0x0000000002254a5e clang::FrontendAction::Execute()
(.../build/bin/clang-6.0+0x2254a5e)
#22 0x000000000222e6fd
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(.../build/bin/clang-6.0+0x222e6fd)
#23 0x00000000022df9e4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(.../build/bin/clang-6.0+0x22df9e4)
#24 0x0000000000ac4048 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (.../build/bin/clang-6.0+0xac4048)
#25 0x0000000000a42536 main (.../build/bin/clang-6.0+0xa42536)
#26 0x00007fb3ea031c05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#27 0x0000000000abfa59 _start (.../build/bin/clang-6.0+0xabfa59)
Stack dump:
0.      Program arguments: .../build/bin/clang-6.0 -cc1 -triple
i386-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name supernice.c -mrelocation-model static
-mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-fuse-init-array -target-cpu skx -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -resource-dir .../build/lib/clang/6.0.0 -D ILLEGAL
-c-isystem .../last_release/projects/openmp/runtime/src -c-isystem
.../libedit/include -c-isystem . -cxx-isystem
.../last_release/projects/openmp/runtime/src -cxx-isystem .../libedit/include
-cxx-isystem . -internal-isystem /usr/local/include -internal-isystem
.../build/lib/clang/6.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir /test
-ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc
-fdiagnostics-show-option -vectorize-loops -vectorize-slp -o
/tmp/supernice-8384a6.o -x c supernice.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'supernice.c'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@fill'
clang-6.0: error: unable to execute command: Segmentation fault (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 313257)
Target: i386-unknown-linux-gnu
Thread model: posix
InstalledDir: .../last_release/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/supernice-c645bc.c
clang-6.0: note: diagnostic msg: /tmp/supernice-c645bc.sh
clang-6.0: 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/20170914/36f97da6/attachment-0001.html>


More information about the llvm-bugs mailing list