public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/13765] New:  [tree-ssa] stores to different members of the same array should not alias
@ 2004-01-20  7:35 dann at godzilla dot ics dot uci dot edu
  2004-01-20 15:20 ` [Bug optimization/13765] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2004-01-20  7:35 UTC (permalink / raw)
  To: gcc-bugs

int foo (int * arr)
{
  arr[0] = 1;
  arr[1] = 2;
  if (arr[0] != 1)
    abort ();
  if (arr[1] != 2)
    abort ();
}

The first if is not optimized away because, presumably, the 2 stores are not
considered not to alias.

The .optimized dump:

foo (arr)
{
<bb 0>:
  *arr = 1;
  *(arr + 4B) = 2;
  if (*arr != 1) goto <L0>; else goto <L1>;

<L0>:;
  abort ();

<L1>:;
  return;

}

-- 
           Summary:  [tree-ssa] stores to different members of the same
                    array should not alias
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug optimization/13765] [tree-ssa] stores to different members of the same array should not alias
  2004-01-20  7:35 [Bug optimization/13765] New: [tree-ssa] stores to different members of the same array should not alias dann at godzilla dot ics dot uci dot edu
@ 2004-01-20 15:20 ` pinskia at gcc dot gnu dot org
  2004-01-21 20:19 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-20 15:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-20 15:20 -------
Confirmed, PTA does not help either.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |pessimizes-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-20 15:20:25
               date|                            |
            Summary| [tree-ssa] stores to       |[tree-ssa] stores to
                   |different members of the    |different members of the
                   |same array should not alias |same array should not alias
   Target Milestone|---                         |tree-ssa


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


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

* [Bug optimization/13765] [tree-ssa] stores to different members of the same array should not alias
  2004-01-20  7:35 [Bug optimization/13765] New: [tree-ssa] stores to different members of the same array should not alias dann at godzilla dot ics dot uci dot edu
  2004-01-20 15:20 ` [Bug optimization/13765] " pinskia at gcc dot gnu dot org
@ 2004-01-21 20:19 ` pinskia at gcc dot gnu dot org
  2004-05-26 18:21 ` [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same pointer " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-21 20:19 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


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


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

* [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same pointer should not alias
  2004-01-20  7:35 [Bug optimization/13765] New: [tree-ssa] stores to different members of the same array should not alias dann at godzilla dot ics dot uci dot edu
  2004-01-20 15:20 ` [Bug optimization/13765] " pinskia at gcc dot gnu dot org
  2004-01-21 20:19 ` pinskia at gcc dot gnu dot org
@ 2004-05-26 18:21 ` pinskia at gcc dot gnu dot org
  2004-07-05 18:58 ` giovannibajo at libero dot it
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-26 18:21 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.5.0                       |---


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


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

* [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same pointer should not alias
  2004-01-20  7:35 [Bug optimization/13765] New: [tree-ssa] stores to different members of the same array should not alias dann at godzilla dot ics dot uci dot edu
                   ` (2 preceding siblings ...)
  2004-05-26 18:21 ` [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same pointer " pinskia at gcc dot gnu dot org
@ 2004-07-05 18:58 ` giovannibajo at libero dot it
  2004-07-12 21:40 ` [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array " dann at godzilla dot ics dot uci dot edu
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-05 18:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-07-05 18:58 -------
As requested.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array should not alias
  2004-01-20  7:35 [Bug optimization/13765] New: [tree-ssa] stores to different members of the same array should not alias dann at godzilla dot ics dot uci dot edu
                   ` (3 preceding siblings ...)
  2004-07-05 18:58 ` giovannibajo at libero dot it
@ 2004-07-12 21:40 ` dann at godzilla dot ics dot uci dot edu
  2004-07-13  0:08 ` dnovillo at redhat dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2004-07-12 21:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dann at godzilla dot ics dot uci dot edu  2004-07-12 21:40 -------
Another testcase for whoever is going to fix this:

struct st
{
  int *arr;
  int c;
  int d;
  int fl;
};

void foo (struct st *s, int a, int b, int c, int d)
{
  *(s->arr) = a; s->arr++;
  *(s->arr) = b; s->arr++;
  *(s->arr) = c; s->arr++;
}

void foo2 (struct st *s, int a, int b, int c, int d)
{
  int *p = s->arr;
  *(p) = a; p++;
  *(p) = b; p++;
  *(p) = c; p++;
  s->arr = p;
}

The 2 functions above are compiled to the same assembly code by gcc-3.4 -O2, 
the .vars dump for them should be very similar too. It is not so currently. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[tree-ssa] stores to        |[tree-ssa] stores to
                   |different members of the    |different members of the
                   |same pointer should not     |same array should not alias
                   |alias                       |


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


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

* [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array should not alias
  2004-01-20  7:35 [Bug optimization/13765] New: [tree-ssa] stores to different members of the same array should not alias dann at godzilla dot ics dot uci dot edu
                   ` (4 preceding siblings ...)
  2004-07-12 21:40 ` [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array " dann at godzilla dot ics dot uci dot edu
@ 2004-07-13  0:08 ` dnovillo at redhat dot com
  2004-10-28 20:31 ` dnovillo at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dnovillo at redhat dot com @ 2004-07-13  0:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at redhat dot com  2004-07-13 00:08 -------
Subject: Re:  [tree-ssa] stores to different
	members of the same array should not alias

On Mon, 2004-07-12 at 17:40, dann at godzilla dot ics dot uci dot edu
wrote:
> ------- Additional Comments From dann at godzilla dot ics dot uci dot edu  2004-07-12 21:40 -------
> Another testcase for whoever is going to fix this:
> 
Thanks.  I'll be looking at this after I'm done with the current pass
reorganization.


Diego.



-- 


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


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

* [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array should not alias
  2004-01-20  7:35 [Bug optimization/13765] New: [tree-ssa] stores to different members of the same array should not alias dann at godzilla dot ics dot uci dot edu
                   ` (5 preceding siblings ...)
  2004-07-13  0:08 ` dnovillo at redhat dot com
@ 2004-10-28 20:31 ` dnovillo at gcc dot gnu dot org
  2004-10-28 20:34 ` dnovillo at gcc dot gnu dot org
  2004-10-28 21:58 ` dberlin at dberlin dot org
  8 siblings, 0 replies; 10+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-10-28 20:31 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|dnovillo at gcc dot gnu dot |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


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


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

* [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array should not alias
  2004-01-20  7:35 [Bug optimization/13765] New: [tree-ssa] stores to different members of the same array should not alias dann at godzilla dot ics dot uci dot edu
                   ` (6 preceding siblings ...)
  2004-10-28 20:31 ` dnovillo at gcc dot gnu dot org
@ 2004-10-28 20:34 ` dnovillo at gcc dot gnu dot org
  2004-10-28 21:58 ` dberlin at dberlin dot org
  8 siblings, 0 replies; 10+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-10-28 20:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-10-28 20:34 -------

Dan, ISTR you saying that the field based stuff would also help with arrays.  Or
do we want to implement array-SSA?  (I'd rather not, in principle).

*** This bug has been marked as a duplicate of 13761 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dberlin at gcc dot gnu dot
                   |                            |org
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array should not alias
  2004-01-20  7:35 [Bug optimization/13765] New: [tree-ssa] stores to different members of the same array should not alias dann at godzilla dot ics dot uci dot edu
                   ` (7 preceding siblings ...)
  2004-10-28 20:34 ` dnovillo at gcc dot gnu dot org
@ 2004-10-28 21:58 ` dberlin at dberlin dot org
  8 siblings, 0 replies; 10+ messages in thread
From: dberlin at dberlin dot org @ 2004-10-28 21:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at dberlin dot org  2004-10-28 21:57 -------
Subject: Re:  [tree-ssa] stores to different
 members of the same array should not alias


>
> Dan, ISTR you saying that the field based stuff would also help with arrays.

Yes, i can make it happen on arrays as well (for fixed size arrays).

> Or
> do we want to implement array-SSA?  (I'd rather not, in principle).
I'd rather not either.



-- 


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


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

end of thread, other threads:[~2004-10-28 21:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-20  7:35 [Bug optimization/13765] New: [tree-ssa] stores to different members of the same array should not alias dann at godzilla dot ics dot uci dot edu
2004-01-20 15:20 ` [Bug optimization/13765] " pinskia at gcc dot gnu dot org
2004-01-21 20:19 ` pinskia at gcc dot gnu dot org
2004-05-26 18:21 ` [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same pointer " pinskia at gcc dot gnu dot org
2004-07-05 18:58 ` giovannibajo at libero dot it
2004-07-12 21:40 ` [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array " dann at godzilla dot ics dot uci dot edu
2004-07-13  0:08 ` dnovillo at redhat dot com
2004-10-28 20:31 ` dnovillo at gcc dot gnu dot org
2004-10-28 20:34 ` dnovillo at gcc dot gnu dot org
2004-10-28 21:58 ` dberlin at dberlin 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).