<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    Hi,<br>
    <br>
    No, it shouldn't reason or warn about strict aliasing. It
    potentially could and i'd love it to, but as of now it doesn't. When
    it does, like in <a class="moz-txt-link-freetext" href="https://bugs.llvm.org/show_bug.cgi?id=47727">https://bugs.llvm.org/show_bug.cgi?id=47727</a>, it's a
    bug in the static analyzer, namely yet another instance of
    <a class="moz-txt-link-freetext" href="https://bugs.llvm.org/show_bug.cgi?id=44114">https://bugs.llvm.org/show_bug.cgi?id=44114</a>. In particular, if you
    change one of the types to char (or something like that), it'll
    bypass the strict aliasing rule and the analyzer would still emit a
    warning which would then be a definite false positive. I'll reply to
    that bug report.<br>
    <br>
    <div class="moz-cite-prefix">On 10/28/20 2:31 AM, Sam Elliott via
      cfe-dev wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:B02ECE1F-714C-4B68-A34E-550C22F19F1B@lowrisc.org">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      Hi Cfe-dev,
      <div class=""><br class="">
      </div>
      <div class="">I'm not particularly familiar with the clang static
        analzyer, so would like some help with a bug that was filed
        against it (when compiling for RISC-V, but I don't think that's
        the issue here, as the bug also shows up with the default
        target).</div>
      <div class=""><br class="">
      </div>
      <div class="">The bug is here: <a
          href="https://bugs.llvm.org/show_bug.cgi?id=47727" class=""
          moz-do-not-send="true">https://bugs.llvm.org/show_bug.cgi?id=47727</a></div>
      <div class=""><br class="">
      </div>
      <div class="">Is it expected that the static analzyer will catch
        (some?) strict aliasing issues like this?</div>
      <div class=""><br class="">
      </div>
      <div class="">Sam</div>
      <div class=""><br class="">
        <div class="">
          <div dir="auto" style="caret-color: rgb(0, 0, 0); color:
            rgb(0, 0, 0); letter-spacing: normal; text-align: start;
            text-indent: 0px; text-transform: none; white-space: normal;
            word-spacing: 0px; -webkit-text-stroke-width: 0px;
            text-decoration: none; word-wrap: break-word;
            -webkit-nbsp-mode: space; line-break: after-white-space;"
            class="">
            <div dir="auto" style="caret-color: rgb(0, 0, 0); color:
              rgb(0, 0, 0); letter-spacing: normal; text-align: start;
              text-indent: 0px; text-transform: none; white-space:
              normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none; word-wrap: break-word;
              -webkit-nbsp-mode: space; line-break: after-white-space;"
              class="">
              <div dir="auto" style="caret-color: rgb(0, 0, 0); color:
                rgb(0, 0, 0); letter-spacing: normal; text-align: start;
                text-indent: 0px; text-transform: none; white-space:
                normal; word-spacing: 0px; -webkit-text-stroke-width:
                0px; text-decoration: none; word-wrap: break-word;
                -webkit-nbsp-mode: space; line-break:
                after-white-space;" class="">
                <div dir="auto" style="caret-color: rgb(0, 0, 0); color:
                  rgb(0, 0, 0); letter-spacing: normal; text-align:
                  start; text-indent: 0px; text-transform: none;
                  white-space: normal; word-spacing: 0px;
                  -webkit-text-stroke-width: 0px; text-decoration: none;
                  word-wrap: break-word; -webkit-nbsp-mode: space;
                  line-break: after-white-space;" class="">
                  <div dir="auto" style="caret-color: rgb(0, 0, 0);
                    color: rgb(0, 0, 0); letter-spacing: normal;
                    text-align: start; text-indent: 0px; text-transform:
                    none; white-space: normal; word-spacing: 0px;
                    -webkit-text-stroke-width: 0px; text-decoration:
                    none; word-wrap: break-word; -webkit-nbsp-mode:
                    space; line-break: after-white-space;" class="">
                    <div dir="auto" style="caret-color: rgb(0, 0, 0);
                      color: rgb(0, 0, 0); letter-spacing: normal;
                      text-align: start; text-indent: 0px;
                      text-transform: none; white-space: normal;
                      word-spacing: 0px; -webkit-text-stroke-width: 0px;
                      text-decoration: none; word-wrap: break-word;
                      -webkit-nbsp-mode: space; line-break:
                      after-white-space;" class="">
                      <div dir="auto" style="caret-color: rgb(0, 0, 0);
                        color: rgb(0, 0, 0); letter-spacing: normal;
                        text-align: start; text-indent: 0px;
                        text-transform: none; white-space: normal;
                        word-spacing: 0px; -webkit-text-stroke-width:
                        0px; text-decoration: none; word-wrap:
                        break-word; -webkit-nbsp-mode: space;
                        line-break: after-white-space;" class="">
                        <div dir="auto" style="caret-color: rgb(0, 0,
                          0); color: rgb(0, 0, 0); letter-spacing:
                          normal; text-align: start; text-indent: 0px;
                          text-transform: none; white-space: normal;
                          word-spacing: 0px; -webkit-text-stroke-width:
                          0px; text-decoration: none; word-wrap:
                          break-word; -webkit-nbsp-mode: space;
                          line-break: after-white-space;" class="">
                          <div dir="auto" style="caret-color: rgb(0, 0,
                            0); color: rgb(0, 0, 0); letter-spacing:
                            normal; text-align: start; text-indent: 0px;
                            text-transform: none; white-space: normal;
                            word-spacing: 0px;
                            -webkit-text-stroke-width: 0px;
                            text-decoration: none; word-wrap:
                            break-word; -webkit-nbsp-mode: space;
                            line-break: after-white-space;" class="">
                            <div dir="auto" style="caret-color: rgb(0,
                              0, 0); color: rgb(0, 0, 0);
                              letter-spacing: normal; text-align: start;
                              text-indent: 0px; text-transform: none;
                              white-space: normal; word-spacing: 0px;
                              -webkit-text-stroke-width: 0px;
                              text-decoration: none; word-wrap:
                              break-word; -webkit-nbsp-mode: space;
                              line-break: after-white-space;" class="">
                              <div dir="auto" style="caret-color: rgb(0,
                                0, 0); color: rgb(0, 0, 0);
                                letter-spacing: normal; text-align:
                                start; text-indent: 0px; text-transform:
                                none; white-space: normal; word-spacing:
                                0px; -webkit-text-stroke-width: 0px;
                                text-decoration: none; word-wrap:
                                break-word; -webkit-nbsp-mode: space;
                                line-break: after-white-space;" class="">
                                <div>--</div>
                                <div>Sam Elliott</div>
                                <div>Software Team Lead</div>
                                <div>Senior Software Developer - LLVM
                                  and OpenTitan</div>
                                <div>lowRISC CIC</div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <br class="">
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>