<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 - Invalid runtime error"
   href="https://bugs.llvm.org/show_bug.cgi?id=36343">36343</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Invalid runtime error
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>tydeman@tybor.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>/*
 * Invalid runtime error: load of bad bool value.
 * Using clang 5.0.1-1 on 64-bit Fedora Linux 27 on Intel core i5

# flags common to both compiler and linker
export CLFLAGS="-fsanitize=memory -fsanitize=undefined
-fno-sanitize=float-cast-overflow -fno-sanitize=float-divide-by-zero"

# flags for compiler
export CFLAGS="-std=c1x -m64 -mfpmath=sse -msse2 -O0 -fno-fast-math -pedantic
-fmath-errno"

 */

#include <stdbool.h>    /* bool */
#include <complex.h>    /* I */

static float complex f2cx;
static struct bit2 {
  unsigned int uibf : 7;
    signed int sibf : 7;
 /*plain*/ int pibf : 7;
          bool bobf : 1;
  unsigned char after[16];
} bits
= {1u,1,1,(bool)1,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};

int main(void){
  struct bit2 res;

  res.bobf = (bool)1;
  f2cx = 1.5f + I*1.5f;
  res.bobf = bits.bobf += f2cx; /* incorrect error here */

  return 0;
}</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>