[trans-mem] PR47690: redirect recursive calls in a clone correctly

Patrick Marlier patrick.marlier@unine.ch
Tue Feb 15 18:21:00 GMT 2011



On Tue, 15 Feb 2011, Richard Henderson wrote:

> On 02/15/2011 07:53 AM, Patrick Marlier wrote:
>> Hi Aldy,
>>
>> On 02/15/2011 04:31 PM, Aldy Hernandez wrote:
>>> Consider a sample where a transaction callable function has a recursive
>>> call to itself:
>>>
>>> int george;
>>> void NewQueueNode()
>>> {
>>>           __transaction [[atomic]] { george=999; }
>>>           NewQueueNode();
>>> }
>>>
>>> Currently, when we are transforming calls to their transactional clone
>>> counterparts, we stop transforming once we reach the end of a
>>> transaction.  Ultimately, this means that in the cloned function, the
>>> recursive call to NewQueueNode() will have the edges redirected to the
>>> clone, but the gimple_call_fndecl() in the clone will still be pointing
>>> to the original function.  This causes cgraph verification to fail with
>>> a "edge points to wrong declaration" ICE.
>>
>> But in this case, why is NewQueueNode cloned?
>> It shouldn't because it is never called in a transaction and it is not a transaction safe function.
>
> I was about to ask the very same question.

Actually I have already filled a PR about this cloned problem:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47689

The testcase inside is almost the same.

Patrick.



More information about the Gcc-patches mailing list