[Bug middle-end/56108] Asm statement in transaction_relaxed crashes compiler.

aldyh at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 19 02:15:00 GMT 2013


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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu.org

--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2013-02-19 02:15:12 UTC ---
The first statement of this relaxed transaction is an inline asm:

  __transaction_relaxed { __asm__(""); }

The problem here is we don't insert a BUILT_IN_TM_IRREVOCABLE call at the
beginning of the transaction because we bypass doing so here:

 for (region = d->all_tm_regions; region; region = region->next)
    {
      /* If we're sure to go irrevocable, don't transform anything.  */
      if (d->irrevocable_blocks_normal
      && bitmap_bit_p (d->irrevocable_blocks_normal,
               region->entry_block->index))
    {
      transaction_subcode_ior (region, GTMA_DOES_GO_IRREVOCABLE);
      transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);
      continue;
    }

      need_ssa_rename |=
    ipa_tm_transform_calls (node, region, region->entry_block,
                d->irrevocable_blocks_normal);
    }

I don't understand why we explicitly bypass here.  I mean, if this bypass was
for TM clones, we're already handling them up-stack in the call to
ipa_tm_transform_clone.

Perhaps we want something like this: 

       if (d->irrevocable_blocks_normal
          && bitmap_bit_p (d->irrevocable_blocks_normal,
                           region->entry_block->index))
-       {
-         transaction_subcode_ior (region, GTMA_DOES_GO_IRREVOCABLE);
-         transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);
-         continue;
-       }
+       transaction_subcode_ior (region, GTMA_DOES_GO_IRREVOCABLE);

       need_ssa_rename |=

But it's causing: FAIL: gcc.dg/tm/memopt-1.c, which I'm investigating.



More information about the Gcc-bugs mailing list