public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56419] New: [4.8 regression] transactions in for-loops disappear
@ 2013-02-21 14:29 torvald at gcc dot gnu.org
  2013-02-21 14:46 ` [Bug c++/56419] " aldyh at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: torvald at gcc dot gnu.org @ 2013-02-21 14:29 UTC (permalink / raw)
  To: gcc-bugs


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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/56419] [4.8 regression] transactions in for-loops disappear
  2013-02-21 14:29 [Bug c++/56419] New: [4.8 regression] transactions in for-loops disappear torvald at gcc dot gnu.org
@ 2013-02-21 14:46 ` aldyh at gcc dot gnu.org
  2013-02-21 14:52 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: aldyh at gcc dot gnu.org @ 2013-02-21 14:46 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-02-21
         AssignedTo|unassigned at gcc dot       |aldyh at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.8.0
     Ever Confirmed|0                           |1

--- Comment #1 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2013-02-21 14:46:37 UTC ---
Confirmed.  Worked in 4.7.  Mine.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/56419] [4.8 regression] transactions in for-loops disappear
  2013-02-21 14:29 [Bug c++/56419] New: [4.8 regression] transactions in for-loops disappear torvald at gcc dot gnu.org
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-21 14:52 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-21 14:51:49 UTC ---
Broken by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186546


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/56419] [4.8 regression] transactions in for-loops disappear
  2013-02-21 14:29 [Bug c++/56419] New: [4.8 regression] transactions in for-loops disappear torvald at gcc dot gnu.org
  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
  4 siblings, 0 replies; 6+ messages in thread
From: aldyh at gcc dot gnu.org @ 2013-02-22 14:55 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2013-02-22 14:54:32 UTC ---
Proposed patch:
http://gcc.gnu.org/ml/gcc-patches/2013-02/msg01058.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/56419] [4.8 regression] transactions in for-loops disappear
  2013-02-21 14:29 [Bug c++/56419] New: [4.8 regression] transactions in for-loops disappear torvald at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: aldyh at gcc dot gnu.org @ 2013-02-26 12:41 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2013-02-26 12:40:36 UTC ---
Author: aldyh
Date: Tue Feb 26 12:40:27 2013
New Revision: 196282

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196282
Log:
    PR c++/56419
    * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
    (build_transaction_expr): Same.

Added:
    trunk/gcc/testsuite/g++.dg/tm/pr56419.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/56419] [4.8 regression] transactions in for-loops disappear
  2013-02-21 14:29 [Bug c++/56419] New: [4.8 regression] transactions in for-loops disappear torvald at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-02-26 12:41 ` aldyh at gcc dot gnu.org
@ 2013-02-26 12:41 ` aldyh at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: aldyh at gcc dot gnu.org @ 2013-02-26 12:41 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2013-02-26 12:41:35 UTC ---
Fixed in trunk.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-26 12:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-21 14:29 [Bug c++/56419] New: [4.8 regression] transactions in for-loops disappear torvald at gcc dot gnu.org
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

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).