public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure
@ 2011-11-16 16:13 aldyh at gcc dot gnu.org
  2011-11-16 16:30 ` [Bug other/51165] " aldyh at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: aldyh at gcc dot gnu.org @ 2011-11-16 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51165
           Summary: gcc.dg/tm/memopt-3.c failure
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: aldyh@gcc.gnu.org


This is a missed optimization that broke after the
trunk->transactional-memory-branch merge on 2011-09-14.  The failure has been
XFAILed, but should eventually be fixed.


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

* [Bug other/51165] gcc.dg/tm/memopt-3.c failure
  2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
@ 2011-11-16 16:30 ` aldyh at gcc dot gnu.org
  2012-01-10 18:53 ` aldyh at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aldyh at gcc dot gnu.org @ 2011-11-16 16:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-11-16
     Ever Confirmed|0                           |1


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

* [Bug other/51165] gcc.dg/tm/memopt-3.c failure
  2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
  2011-11-16 16:30 ` [Bug other/51165] " aldyh at gcc dot gnu.org
@ 2012-01-10 18:53 ` aldyh at gcc dot gnu.org
  2012-01-10 18:56 ` aldyh at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aldyh at gcc dot gnu.org @ 2012-01-10 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-01-10 18:53:12 UTC ---
*** Bug 51166 has been marked as a duplicate of this bug. ***


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

* [Bug other/51165] gcc.dg/tm/memopt-3.c failure
  2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-01-10 18:56 ` aldyh at gcc dot gnu.org
@ 2012-01-10 18:56 ` aldyh at gcc dot gnu.org
  2012-01-10 18:58 ` aldyh at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aldyh at gcc dot gnu.org @ 2012-01-10 18:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-01-10 18:54:55 UTC ---
*** Bug 51167 has been marked as a duplicate of this bug. ***


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

* [Bug other/51165] gcc.dg/tm/memopt-3.c failure
  2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
  2011-11-16 16:30 ` [Bug other/51165] " aldyh at gcc dot gnu.org
  2012-01-10 18:53 ` aldyh at gcc dot gnu.org
@ 2012-01-10 18:56 ` aldyh at gcc dot gnu.org
  2012-01-10 18:56 ` aldyh at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aldyh at gcc dot gnu.org @ 2012-01-10 18:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-01-10 18:55:58 UTC ---
*** Bug 51168 has been marked as a duplicate of this bug. ***


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

* [Bug other/51165] gcc.dg/tm/memopt-3.c failure
  2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-01-10 18:56 ` aldyh at gcc dot gnu.org
@ 2012-01-10 18:58 ` aldyh at gcc dot gnu.org
  2012-01-11 15:07 ` aldyh at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aldyh at gcc dot gnu.org @ 2012-01-10 18:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |aldyh at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-01-10 18:57:38 UTC ---
Mine.  The failed tests memopt-[3457].c are all the same bug.


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

* [Bug other/51165] gcc.dg/tm/memopt-3.c failure
  2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-01-10 18:58 ` aldyh at gcc dot gnu.org
@ 2012-01-11 15:07 ` aldyh at gcc dot gnu.org
  2012-01-11 15:14 ` rguenther at suse dot de
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aldyh at gcc dot gnu.org @ 2012-01-11 15:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-01-11 15:07:15 UTC ---
The main problem here is that we are using ptr_deref_may_alias_global_p() to
determine if a dereferenced address escapes whereas we were previously using
is_call_clobbered() which understood VAR_DECLs, not just SSA_NAMEs.

In requires_barrier() we call ptr_deref_may_alias_global_p() to determine if
the address of `lala' below will escape:

struct large { int x[100]; };
extern struct large foobie (void) __attribute__((transaction_safe));
int asdf;

int f()
{ 
  struct large lala;
  struct large lacopy = foobie();
  __transaction_atomic {
    lala = lacopy;   <-- STORE SHOULD BE TRXN/THREAD LOCAL
  }
  return lala.x[asdf];
}

Before the fix to PR tree-optimization/43572, we used is_call_clobbered() which
returned false for `lala', and everything worked fine.  However, we are now
using ptr_deref_may_alias_global_p() which only understands SSA_NAMEs, and
`lala' is a VAR_DECL.

Mr. Guenther (or Mr. Henderson), what is the recommended course of action here?

As an aside (for the PR record), requires_barrier() also needs to handle
ARRAY_REF.


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

* [Bug other/51165] gcc.dg/tm/memopt-3.c failure
  2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-01-11 15:07 ` aldyh at gcc dot gnu.org
@ 2012-01-11 15:14 ` rguenther at suse dot de
  2012-01-17 13:49 ` aldyh at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenther at suse dot de @ 2012-01-11 15:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> 2012-01-11 15:13:39 UTC ---
On Wed, 11 Jan 2012, aldyh at gcc dot gnu.org wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51165
> 
> Aldy Hernandez <aldyh at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |rguenth at gcc dot gnu.org,
>                    |                            |rth at gcc dot gnu.org
> 
> --- Comment #5 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-01-11 15:07:15 UTC ---
> The main problem here is that we are using ptr_deref_may_alias_global_p() to
> determine if a dereferenced address escapes whereas we were previously using
> is_call_clobbered() which understood VAR_DECLs, not just SSA_NAMEs.
> 
> In requires_barrier() we call ptr_deref_may_alias_global_p() to determine if
> the address of `lala' below will escape:
> 
> struct large { int x[100]; };
> extern struct large foobie (void) __attribute__((transaction_safe));
> int asdf;
> 
> int f()
> { 
>   struct large lala;
>   struct large lacopy = foobie();
>   __transaction_atomic {
>     lala = lacopy;   <-- STORE SHOULD BE TRXN/THREAD LOCAL
>   }
>   return lala.x[asdf];
> }
> 
> Before the fix to PR tree-optimization/43572, we used is_call_clobbered() which
> returned false for `lala', and everything worked fine.  However, we are now
> using ptr_deref_may_alias_global_p() which only understands SSA_NAMEs, and
> `lala' is a VAR_DECL.
> 
> Mr. Guenther (or Mr. Henderson), what is the recommended course of action here?

If you want to check whether something possibly escaped you can
use may_be_aliased (get_base_address (xxxx)) and if xxx is always
a VAR_DECL you can omit get_base_address.  If get_base_addres (xxxx)
returns a MEM_REF you can refine the result by calling
ptr_deref_may_alias_global_p on its operand 0 (the pointer to the object).
There is no existing predicate that would answer whether a tree
accesses possibly 'escaped' memory (yet).  If you write one,
stick it into tree-ssa-alias.c.

Richard.


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

* [Bug other/51165] gcc.dg/tm/memopt-3.c failure
  2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-01-11 15:14 ` rguenther at suse dot de
@ 2012-01-17 13:49 ` aldyh at gcc dot gnu.org
  2012-01-17 13:51 ` aldyh at gcc dot gnu.org
  2022-01-07  5:09 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: aldyh at gcc dot gnu.org @ 2012-01-17 13:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-01-17 13:20:34 UTC ---
Author: aldyh
Date: Tue Jan 17 13:20:28 2012
New Revision: 183242

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183242
Log:
        PR other/51165
        * trans-mem.c (requires_barrier): Call may_be_aliased.
testsuite/
        PR other/51165
        * gcc.dg/tm/memopt-3.c: Remove xfail.
        * gcc.dg/tm/memopt-4.c: Remove xfail.
        * gcc.dg/tm/memopt-5.c: Remove xfail.
        * gcc.dg/tm/memopt-7.c: Remove xfail.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/tm/memopt-3.c
    trunk/gcc/testsuite/gcc.dg/tm/memopt-4.c
    trunk/gcc/testsuite/gcc.dg/tm/memopt-5.c
    trunk/gcc/testsuite/gcc.dg/tm/memopt-7.c
    trunk/gcc/trans-mem.c


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

* [Bug other/51165] gcc.dg/tm/memopt-3.c failure
  2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2012-01-17 13:49 ` aldyh at gcc dot gnu.org
@ 2012-01-17 13:51 ` aldyh at gcc dot gnu.org
  2022-01-07  5:09 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: aldyh at gcc dot gnu.org @ 2012-01-17 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-01-17 13:22:47 UTC ---
fixed


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

* [Bug other/51165] gcc.dg/tm/memopt-3.c failure
  2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2012-01-17 13:51 ` aldyh at gcc dot gnu.org
@ 2022-01-07  5:09 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-07  5:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51165

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.0

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

end of thread, other threads:[~2022-01-07  5:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-16 16:13 [Bug other/51165] New: gcc.dg/tm/memopt-3.c failure aldyh at gcc dot gnu.org
2011-11-16 16:30 ` [Bug other/51165] " aldyh at gcc dot gnu.org
2012-01-10 18:53 ` aldyh at gcc dot gnu.org
2012-01-10 18:56 ` aldyh at gcc dot gnu.org
2012-01-10 18:56 ` aldyh at gcc dot gnu.org
2012-01-10 18:58 ` aldyh at gcc dot gnu.org
2012-01-11 15:07 ` aldyh at gcc dot gnu.org
2012-01-11 15:14 ` rguenther at suse dot de
2012-01-17 13:49 ` aldyh at gcc dot gnu.org
2012-01-17 13:51 ` aldyh at gcc dot gnu.org
2022-01-07  5:09 ` pinskia 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).