<div dir="ltr">The test case in Bug 14223 is working fine with the latest trunk version.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 5, 2014 at 12:25 AM, Halfdan Ingvarsson <span dir="ltr"><<a href="mailto:halfdan@sidefx.com" target="_blank">halfdan@sidefx.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Possibly related to this:
<a href="http://llvm.org/bugs/show_bug.cgi?id=14223" target="_blank">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>
- ½<div><div class="h5"><br>
<br>
On 14-04-04 12:39 PM, suyog sarda wrote:<br>
</div></div></div>
<blockquote type="cite"><div><div class="h5">
<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 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></fieldset>
<br>
</div></div><div class=""><pre>_______________________________________________
cfe-dev mailing list
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a>
</pre>
</div></blockquote>
<br>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>With regards,<br>Suyog Sarda<br>
</div>