<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Possibly related to this:
      <a class="moz-txt-link-freetext" href="http://llvm.org/bugs/show_bug.cgi?id=14223">http://llvm.org/bugs/show_bug.cgi?id=14223</a><br>
      <br>
      We still compile specific projects with -O1 to get around this
      issue.<br>
      <br>
       - &frac12;<br>
      <br>
      On 14-04-04 12:39 PM, suyog sarda wrote:<br>
    </div>
    <blockquote
cite="mid:CAPPX+uF50bYtkLMUMfPDjG+rtVQqEBP2vynUkxGeqLHzy+nW5A@mail.gmail.com"
      type="cite">
      <div dir="ltr">Gentle Ping !! Please help to verify if this is a
        bug and if my analysis is correct.<br>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Tue, Apr 1, 2014 at 10:18 PM, suyog
          sarda <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:sardask01@gmail.com" target="_blank">sardask01@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>Hi all,<br>
                <br>
              </div>
              <div>This is a test g++ test case for checking correct
                exception handling.<br>
                <br>
              </div>
              <div><i>#ifdef __GXX_EXPERIMENTAL_CXX0X__<br>
                  #define NOEXCEPT_FALSE noexcept (false)<br>
                  #else<br>
                  #define NOEXCEPT_FALSE<br>
                  #endif<br>
                  <br>
                  extern "C" void abort ();<br>
                   <br>
                  int thrown;<br>
                  <br>
                  int as;<br>
                  struct a {<br>
                    a () { ++as; }<br>
                    ~a () NOEXCEPT_FALSE { --as; if (thrown++ == 0)
                  throw 42; }<br>
                  };<br>
                   <br>
                  int f (a const&) { return 1; }<br>
                  int f (a const&, a const&) { return 1; }<br>
                  <br>
                  int bs;<br>
                  int as_sav;<br>
                  struct b {<br>
                    b (...) { ++bs; }<br>
                    ~b ()   { --bs; as_sav = as; }<br>
                  };<br>
                  <br>
                  bool p;<br>
                  void g()<br>
                  {<br>
                    if (p) throw 42;<br>
                  }<br>
                  <br>
                  int main () {<br>
                    thrown = 0;<br>
                    try {<br>
                      b tmp(f (a(), a()));<br>
                  <br>
                      g();<br>
                    }  <br>
                    catch (...) {}<br>
                  <br>
                    // We throw when the first a is destroyed, which
                  should destroy b before<br>
                    // the other a.<br>
                    if (as_sav != 1)<br>
                      abort ();<br>
                  <br>
                    thrown = 0;<br>
                    try {<br>
                      b tmp(f (a()));<br>
                  <br>
                      g();<br>
                    }  <br>
                    catch (...) {}<br>
                   <br>
                    if (bs != 0)<br>
                      abort ();<br>
                  } </i><br clear="all">
              </div>
              <div><br>
              </div>
              <div>This Test Case aborts on ARM as well as X86 with
                clang latest trunk while with g++ no aborts are seen .<br>
                <br>
              </div>
              <div>Here, when first temporary object '<i>a'</i> gets
                destroyed, its destructor is called where we throw an
                exception. This should immediately call destructor of <i>'b'</i>
                and before calling constructor of second temporary
                object <i>'a'</i>. Instead, with clang, it is waiting
                for second temporary object <i>'a'</i> to get destroyed
                and then calling its own destructor.<br>
                <br>
              </div>
              <div>In my opinion, the compiler is not generating correct
                landing pad for the exception. Can someone please help
                in validating this reason? If it is a genuine bug then i
                will file a bug and try to work out solution for it. <br>
              </div>
              <div><br>
                --  <br>
                With regards,<br>
                Suyog Sarda<br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        With regards,<br>
        Suyog Sarda<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>