public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/20121] New: Aliasing lameness results in missing common subexpressions
@ 2005-02-21 21:39 law at redhat dot com
  2005-02-21 21:40 ` [Bug tree-optimization/20121] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: law at redhat dot com @ 2005-02-21 21:39 UTC (permalink / raw)
  To: gcc-bugs

Our aliasing code is failing pretty badly in disambiguating memory addresses,
which in turn can lead to missing opportunities to remove memory operations.

Here's an exmaple taken from GCC itself (find_unreachable_blocks):

typedef unsigned int size_t;
extern void *xmalloc (size_t) __attribute__ ((__malloc__));
struct edge_def
{
  struct basic_block_def *dest;
  int flags;
};
typedef struct edge_def *edge;
struct basic_block_def
{
  int flags;
};
typedef struct basic_block_def *basic_block;
extern int n_basic_blocks;
extern edge frob ();
void
find_unreachable_blocks (int frobit)
{
  basic_block *tos, *worklist, bb;
  tos = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
  edge e = frob();
  if (!(e->dest->flags & 4))
    {
      e->dest->flags |= 4;
      *tos++ = e->dest;
    }
}


The store into e->dest->flags does not affect e or e->dest.  Thus we only need
to load e->dest once.  Unfortunately, we load it twice.

I'll be checking this testcase into the testsuite (xfailed appropriately).

-- 
           Summary: Aliasing lameness results in missing common
                    subexpressions
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: law at redhat dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: Any
  GCC host triplet: Any
GCC target triplet: Any


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


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

* [Bug tree-optimization/20121] Aliasing lameness results in missing common subexpressions
  2005-02-21 21:39 [Bug tree-optimization/20121] New: Aliasing lameness results in missing common subexpressions law at redhat dot com
@ 2005-02-21 21:40 ` pinskia at gcc dot gnu dot org
  2005-02-21 21:43 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-21 21:40 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
           Keywords|                            |missed-optimization


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


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

* [Bug tree-optimization/20121] Aliasing lameness results in missing common subexpressions
  2005-02-21 21:39 [Bug tree-optimization/20121] New: Aliasing lameness results in missing common subexpressions law at redhat dot com
  2005-02-21 21:40 ` [Bug tree-optimization/20121] " pinskia at gcc dot gnu dot org
@ 2005-02-21 21:43 ` pinskia at gcc dot gnu dot org
  2005-02-21 21:44 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-21 21:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-21 14:54 -------
Confirmed, CCing Daniel because he is working on structure aliasing right now.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dberlin at gcc dot gnu dot
                   |                            |org, pinskia at gcc dot gnu
                   |                            |dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-02-21 14:54:40
               date|                            |


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


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

* [Bug tree-optimization/20121] Aliasing lameness results in missing common subexpressions
  2005-02-21 21:39 [Bug tree-optimization/20121] New: Aliasing lameness results in missing common subexpressions law at redhat dot com
  2005-02-21 21:40 ` [Bug tree-optimization/20121] " pinskia at gcc dot gnu dot org
  2005-02-21 21:43 ` pinskia at gcc dot gnu dot org
@ 2005-02-21 21:44 ` pinskia at gcc dot gnu dot org
  2005-07-25 15:29 ` steven at gcc dot gnu dot org
  2005-07-25 15:31 ` steven at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-21 21:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-21 15:00 -------
This is basically PR 13761 almong other bugs.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |13761


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


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

* [Bug tree-optimization/20121] Aliasing lameness results in missing common subexpressions
  2005-02-21 21:39 [Bug tree-optimization/20121] New: Aliasing lameness results in missing common subexpressions law at redhat dot com
                   ` (2 preceding siblings ...)
  2005-02-21 21:44 ` pinskia at gcc dot gnu dot org
@ 2005-07-25 15:29 ` steven at gcc dot gnu dot org
  2005-07-25 15:31 ` steven at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-07-25 15:29 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 20121 depends on bug 13761, which changed state.

Bug 13761 Summary: [tree-ssa] component refs to the same struct should not alias
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13761

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

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


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

* [Bug tree-optimization/20121] Aliasing lameness results in missing common subexpressions
  2005-02-21 21:39 [Bug tree-optimization/20121] New: Aliasing lameness results in missing common subexpressions law at redhat dot com
                   ` (3 preceding siblings ...)
  2005-07-25 15:29 ` steven at gcc dot gnu dot org
@ 2005-07-25 15:31 ` steven at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-07-25 15:31 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 20121 depends on bug 13761, which changed state.

Bug 13761 Summary: [tree-ssa] component refs to the same struct should not alias
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13761

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

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


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

end of thread, other threads:[~2005-07-25 15:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-21 21:39 [Bug tree-optimization/20121] New: Aliasing lameness results in missing common subexpressions law at redhat dot com
2005-02-21 21:40 ` [Bug tree-optimization/20121] " pinskia at gcc dot gnu dot org
2005-02-21 21:43 ` pinskia at gcc dot gnu dot org
2005-02-21 21:44 ` pinskia at gcc dot gnu dot org
2005-07-25 15:29 ` steven at gcc dot gnu dot org
2005-07-25 15:31 ` steven at gcc dot gnu dot 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).