<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 - div-rem-pairs crashes: Assertion `!RemOriginallyWasInExpandedForm && "Won't happen for expanded-form rem."' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=43500">43500</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>div-rem-pairs crashes: Assertion `!RemOriginallyWasInExpandedForm && "Won't happen for expanded-form rem."' failed.
          </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>Linux
          </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>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>cszide@163.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22600" name="attach_22600" title="security_pgp_d.bc">attachment 22600</a> <a href="attachment.cgi?id=22600&action=edit" title="security_pgp_d.bc">[details]</a></span>
security_pgp_d.bc

$clang -v
clang version 10.0.0 (trunk 373146)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$opt  -early-cse-memssa -instcombine -loop-rotate -indvars  -sroa -loop-unroll
-correlated-propagation -loop-reduce -div-rem-pairs security_pgp_d.bc 
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.

opt:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/lib/Transforms/Scalar/DivRemPairs.cpp:237:
bool optimizeDivRem(llvm::Function&, const llvm::TargetTransformInfo&, const
llvm::DominatorTree&): Assertion `!RemOriginallyWasInExpandedForm && "Won't
happen for expanded-form rem."' failed.
Stack dump:
0.      Program arguments:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt
-early-cse-memssa -instcombine -loop-rotate -indvars -sroa -loop-unroll
-correlated-propagation -loop-reduce -div-rem-pairs security_pgp_d.bc 
1.      Running pass 'Function Pass Manager' on module 'security_pgp_d.bc'.
2.      Running pass 'Hoist/decompose integer division and remainder' on
function '@date_ymd'
 #0 0x000055b44b79beaa llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2785eaa)
 #1 0x000055b44b799b84 llvm::sys::RunSignalHandlers()
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2783b84)
 #2 0x000055b44b799cc2 SignalHandler(int)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2783cc2)
 #3 0x00007f3dd2113890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007f3dd0dc5e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007f3dd0dc7801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007f3dd0db739a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007f3dd0db7412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x000055b44b4e2478 optimizeDivRem(llvm::Function&,
llvm::TargetTransformInfo const&, llvm::DominatorTree const&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x24cc478)
 #9 0x000055b44b0d9409 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20c3409)
#10 0x000055b44b0d94d9 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20c34d9)
#11 0x000055b44b0d8661 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20c2661)
#12 0x000055b4498a7bcf main
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x891bcf)
#13 0x00007f3dd0da8b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#14 0x000055b44991fe6a _start
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x909e6a)
Aborted (core dumped)

The optimization sequence can be reduced to "-div-rem-pairs" using bugpoint.

$opt bugpoint-reduced-simplified.bc -div-rem-pairs
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.

opt:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/lib/Transforms/Scalar/DivRemPairs.cpp:237:
bool optimizeDivRem(llvm::Function&, const llvm::TargetTransformInfo&, const
llvm::DominatorTree&): Assertion `!RemOriginallyWasInExpandedForm && "Won't
happen for expanded-form rem."' failed.
Stack dump:
0.      Program arguments:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt
bugpoint-reduced-simplified.bc -div-rem-pairs 
1.      Running pass 'Function Pass Manager' on module
'bugpoint-reduced-simplified.bc'.
2.      Running pass 'Hoist/decompose integer division and remainder' on
function '@date_ymd'
 #0 0x000056272b000eaa llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2785eaa)
 #1 0x000056272affeb84 llvm::sys::RunSignalHandlers()
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2783b84)
 #2 0x000056272affecc2 SignalHandler(int)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2783cc2)
 #3 0x00007ffa4ccac890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007ffa4b95ee97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007ffa4b960801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007ffa4b95039a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007ffa4b950412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x000056272ad47478 optimizeDivRem(llvm::Function&,
llvm::TargetTransformInfo const&, llvm::DominatorTree const&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x24cc478)
 #9 0x000056272a93e409 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20c3409)
#10 0x000056272a93e4d9 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20c34d9)
#11 0x000056272a93d661 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20c2661)
#12 0x000056272910cbcf main
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x891bcf)
#13 0x00007ffa4b941b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#14 0x0000562729184e6a _start
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x909e6a)
Aborted (core dumped)</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>