<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - LLVM emits divide by zero where there was none"
   href="https://llvm.org/bugs/show_bug.cgi?id=26452">26452</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM emits divide by zero where there was none
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: WebAssembly
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jfb@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This test:
 
<a href="https://github.com/gcc-mirror/gcc/tree/master/gcc/testsuite/gcc.c-torture/execute/pr60960.c">https://github.com/gcc-mirror/gcc/tree/master/gcc/testsuite/gcc.c-torture/execute/pr60960.c</a>

Uses 4x vectors and scalarizes the operations. It doesn't divide by zero, yet
LLVM generates the following for f1:

f1:                                     # @f1                                   
        .param          i32, i32, i32, i32, i32                                 
# BB#0:                                 # %entry                                
        i32.const       $push0=, 255                                            
        i32.and         $push3=, $2, $pop0                                      
        i32.const       $push8=, 0                                              
        i32.div_u       $2=, $pop3, $pop8                                       
        i32.const       $push19=, 255                                           
        i32.and         $push2=, $3, $pop19                                     
        i32.const       $push18=, 0                                             
        i32.div_u       $3=, $pop2, $pop18                                      
        i32.const       $push10=, 3                                             
        i32.add         $push11=, $0, $pop10                                    
        i32.const       $push17=, 255                                           
        i32.and         $push1=, $4, $pop17                                     
        i32.const       $push16=, 0                                             
        i32.div_u       $push9=, $pop1, $pop16                                  
        i32.store8      $discard=, 0($pop11):p2align=2, $pop9                   
        i32.const       $push12=, 2                                             
        i32.add         $push13=, $0, $pop12                                    
        i32.store8      $discard=, 0($pop13):p2align=2, $3                      
        i32.const       $push6=, 1                                              
        i32.add         $push14=, $0, $pop6                                     
        i32.store8      $discard=, 0($pop14):p2align=2, $2                      
        i32.const       $push4=, 254                                            
        i32.and         $push5=, $1, $pop4                                      
        i32.const       $push15=, 1                                             
        i32.shr_u       $push7=, $pop5, $pop15                                  
        i32.store8      $discard=, 0($0):p2align=2, $pop7                       
        return                                                                  
        .endfunc                                                                
.Lfunc_end0:                                                                    
        .size   f1, .Lfunc_end0-f1</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>