On 12/12/2011 11:19 AM, Aldy Hernandez wrote:

Yes the testcase attached in the PR works for me but I can't change the
status because I am not the reporter (nor admin).

I will close it.

Ok thanks.

However, the testcase I have added g++.dg/tm/ctor-used.C fails. I can
fill another PR but I found this problem thanks to the PR testcase.

If you mean the following test, there is no ICE here either with current
sources. However, I do see that you expect something else to be generated.

If I compile it with optimization (-O1), there is no call to the runtime
as expected (no _ITM_getTMCloneOrIrrevocable), we just inline the
initialization to 0 inside the transaction. And we optimize away the
constructor "C():l(0)".

If I compile with no optimization, there is a the call through the
runtime (which according to your test you DONT expect, why?), and we
generate code for C():l(0). This seems correct.

This is not correct. First, _ITM_getTMCloneOrIrrevocable should never appear in a __transaction_atomic (_ITM_getTMClone is ok). But the problem here is that it fails to detect the clone because of the alias. This is why we end up with a call to _ITM_getTMCloneOrIrrevocable.

I don't see anything wrong with the generated code.

What are you expecting?
I expect a direct call to the clone constructor without asking the runtime (as you see with my patch).

Patrick.

Reply via email to