public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "torvald at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/56419] New: [4.8 regression] transactions in for-loops disappear
Date: Thu, 21 Feb 2013 14:29:00 -0000	[thread overview]
Message-ID: <bug-56419-4@http.gcc.gnu.org/bugzilla/> (raw)


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

             Bug #: 56419
           Summary: [4.8 regression] transactions in for-loops disappear
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: torvald@gcc.gnu.org
                CC: aldyh@gcc.gnu.org, spear@cse.lehigh.edu


Transaction statements in for-loops don't show up in Gimple.  For example:

int x = 0;
int inc_func(int i) {
     for (int j = 0; j < i; ++j)
     {
         __transaction_atomic { x+=1; }
     }
     return 0;
}

g++ -v -O0 test.cc -c -fgnu-tm -fdump-tree-all -Wall
leads to the following test.cc.004t.gimple:

int inc_func(int) (int i)
{
  int D.2360;

  {
    int j;

    j = 0;
    goto <D.2358>;
    <D.2357>:
    j = j + 1;
    <D.2358>:
    if (j < i) goto <D.2357>; else goto <D.2355>;
    <D.2355>:
  }
  D.2360 = 0;
  return D.2360;
}

This does work when using the C frontend.  Seems to also work when the
transaction is in while loops or on an if-branch.  Doesn't seem to be sensitive
to which C++ standard is requested.

Originally reported by Mike Spear.  Mike says this works with 4.7.2, but
doesn't with g++ (GCC) 4.8.0 20130221 (experimental) (revision 
196192).  I've confirmed with an early-December build.


             reply	other threads:[~2013-02-21 14:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-21 14:29 torvald at gcc dot gnu.org [this message]
2013-02-21 14:46 ` [Bug c++/56419] " aldyh at gcc dot gnu.org
2013-02-21 14:52 ` jakub at gcc dot gnu.org
2013-02-22 14:55 ` aldyh at gcc dot gnu.org
2013-02-26 12:41 ` aldyh at gcc dot gnu.org
2013-02-26 12:41 ` aldyh at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56419-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).