<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Regression since SVN r367710, "[DAGCombiner] try to convert opposing shifts to casts""
   href="https://bugs.llvm.org/show_bug.cgi?id=42880">42880</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Regression since SVN r367710, "[DAGCombiner] try to convert opposing shifts to casts"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Common Code Generator Code
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>martin@martin.st
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>lebedev.ri@gmail.com, llvm-bugs@lists.llvm.org, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22333" name="attach_22333" title="Reproduction C code">attachment 22333</a> <a href="attachment.cgi?id=22333&action=edit" title="Reproduction C code">[details]</a></span>
Reproduction C code

Since SVN r367710, "[DAGCombiner] try to convert opposing shifts to casts",
compiling Qt 5.13 for x86 mingw triggers a failed assert:

$ clang++ -target i686-w64-mingw32 -c -O3 -std=c++17 qpainterpath-preproc.cpp
clang-10: ../lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:973: void
{anonymous}::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*): Assertion
`(TLI.getTypeAction(*DAG.getContext(), Op.getValueType()) ==
TargetLowering::TypeLegal || TLI.isTypeLegal(Op.getValueType()) ||
Op.getOpcode() == ISD::TargetConstant || Op.getOpcode() == ISD::Register) &&
"Unexpected illegal type!"' failed.
Stack dump:
0.      Program arguments: /home/martin/code/llvm-bisect/build/bin/clang-10
-cc1 -triple i686-w64-windows-gnu -emit-obj -disable-free -main-file-name
qpainterpath-preproc.cpp -mrelocation-model static -mthread-model posix
-mframe-pointer=none -fmath-errno -masm-verbose -mconstructor-aliases
-target-cpu pentium4 -dwarf-column-info -debugger-tuning=gdb
-coverage-notes-file
/home/martin/code/llvm-bisect/build/qpainterpath-preproc.gcno -resource-dir
/home/martin/code/llvm-bisect/build/lib/clang/10.0.0 -internal-isystem
/usr/i686-w64-mingw32/include/c++ -internal-isystem
/usr/i686-w64-mingw32/include/c++/i686-w64-mingw32 -internal-isystem
/usr/i686-w64-mingw32/include/c++/backward -internal-isystem
/usr/i686-w64-mingw32/include/c++/7.3-win32 -internal-isystem
/usr/i686-w64-mingw32/include/c++/7.3-win32/i686-w64-mingw32 -internal-isystem
/usr/i686-w64-mingw32/include/c++/7.3-win32/backward -internal-isystem
/usr/include/c++/7.3-win32 -internal-isystem
/usr/include/c++/7.3-win32/i686-w64-mingw32 -internal-isystem
/usr/include/c++/7.3-win32/backward -internal-isystem
/usr/lib/gcc/i686-w64-mingw32/7.3-win32/include/c++ -internal-isystem
/usr/lib/gcc/i686-w64-mingw32/7.3-win32/include/c++/i686-w64-mingw32
-internal-isystem /usr/lib/gcc/i686-w64-mingw32/7.3-win32/include/c++/backward
-internal-isystem /home/martin/code/llvm-bisect/build/lib/clang/10.0.0/include
-internal-isystem /usr/i686-w64-mingw32/sys-root/mingw/include
-internal-isystem /usr/i686-w64-mingw32/include -internal-isystem /usr/include
-O3 -std=c++17 -fdeprecated-macro -fdebug-compilation-dir
/home/martin/code/llvm-bisect/build -ferror-limit 19 -fmessage-length 0
-fno-use-cxa-atexit -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdwarf-exceptions -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -faddrsig -o qpainterpath-preproc.o -x c++
qpainterpath-preproc.cpp 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module
'qpainterpath-preproc.cpp'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@_ZN12QPainterPath7addPathERKS_'
 #0 0x0000563a0922a18a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x1f7618a)
 #1 0x0000563a09227e24 llvm::sys::RunSignalHandlers()
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x1f73e24)
 #2 0x0000563a09227f62 SignalHandler(int)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x1f73f62)
 #3 0x00007f233aac3890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007f2339774e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007f2339776801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007f233976639a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007f2339766412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x0000563a09cfaa33 (anonymous
namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) (.part.290)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x2a46a33)
 #9 0x0000563a09d0c1a3 llvm::SelectionDAG::Legalize()
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x2a581a3)
#10 0x0000563a09daacdb llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x2af6cdb)
#11 0x0000563a09daf64b
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x2afb64b)
#12 0x0000563a09db1082
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(.part.807) (/home/martin/code/llvm-bisect/build/bin/clang-10+0x2afd082)
#13 0x0000563a083b227f (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x10fe27f)
#14 0x0000563a088d270e
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x161e70e)
#15 0x0000563a08cc6db9 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x1a12db9)
#16 0x0000563a08cc6eb1 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x1a12eb1)
#17 0x0000563a08cc6011 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x1a12011)
#18 0x0000563a0943a9cf 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> >)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x21869cf)
#19 0x0000563a09e9d0fd
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x2be90fd)
#20 0x0000563a0a845ea9 clang::ParseAST(clang::Sema&, bool, bool)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x3591ea9)
#21 0x0000563a09e9a7f8 clang::CodeGenAction::ExecuteAction()
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x2be67f8)
#22 0x0000563a09905619 clang::FrontendAction::Execute()
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x2651619)
#23 0x0000563a098c90f1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x26150f1)
#24 0x0000563a099b0b6f
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/martin/code/llvm-bisect/build/bin/clang-10+0x26fcb6f)
#25 0x0000563a07f329ff cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/martin/code/llvm-bisect/build/bin/clang-10+0xc7e9ff)
#26 0x0000563a07ec5eb9 main
(/home/martin/code/llvm-bisect/build/bin/clang-10+0xc11eb9)
#27 0x00007f2339757b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#28 0x0000563a07f2e18a _start
(/home/martin/code/llvm-bisect/build/bin/clang-10+0xc7a18a)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>