public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/13762] New: [tree-ssa] stores to different members of the same array should not alias
@ 2004-01-20  7:12 dann at godzilla dot ics dot uci dot edu
  2004-01-20  7:22 ` [Bug optimization/13762] " marcus at jet dot franken dot de
  2004-01-20  7:30 ` dann at godzilla dot ics dot uci dot edu
  0 siblings, 2 replies; 3+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2004-01-20  7:12 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.

Also strange is that the second store is performed twice.

The .optimized dump:

foo (arr)
{
  int * T.1;

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

<L0>:;
  abort ();

<L1>:;
  *T.1 = 2;
  abort ();

}

-- 
           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=13762


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

* [Bug optimization/13762] [tree-ssa] stores to different members of the same array should not alias
  2004-01-20  7:12 [Bug optimization/13762] 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  7:22 ` marcus at jet dot franken dot de
  2004-01-20  7:30 ` dann at godzilla dot ics dot uci dot edu
  1 sibling, 0 replies; 3+ messages in thread
From: marcus at jet dot franken dot de @ 2004-01-20  7:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From marcus at jet dot franken dot de  2004-01-20 07:21 -------
you wanted to write if (a[0] == 2), not a[0]=2 i guess... 
 
 

-- 


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


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

* [Bug optimization/13762] [tree-ssa] stores to different members of the same array should not alias
  2004-01-20  7:12 [Bug optimization/13762] 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  7:22 ` [Bug optimization/13762] " marcus at jet dot franken dot de
@ 2004-01-20  7:30 ` dann at godzilla dot ics dot uci dot edu
  1 sibling, 0 replies; 3+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2004-01-20  7:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dann at godzilla dot ics dot uci dot edu  2004-01-20 07:30 -------
Actually it should have been arr[1] != 2
I'll close this bug and open one with the correct testcase. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2004-01-20  7:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-20  7:12 [Bug optimization/13762] 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  7:22 ` [Bug optimization/13762] " marcus at jet dot franken dot de
2004-01-20  7:30 ` dann at godzilla dot ics dot uci dot edu

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