public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/15262] New: [tree-ssa] Alias analyzer cannot handle addressable fields
@ 2004-05-03 14:22 dnovillo at gcc dot gnu dot org
  2004-05-03 14:47 ` [Bug optimization/15262] " pinskia at gcc dot gnu dot org
                   ` (15 more replies)
  0 siblings, 16 replies; 18+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-05-03 14:22 UTC (permalink / raw)
  To: gcc-bugs

The type-based alias analyzer cannot handle aliasing fields in structures.  Given
&PTR->FIELD, it fails to build alias sets for PTR's memory tag.  There is very
limited support for handling it, but it needs to be revamped.

Filing as a bug against the branch.  I've got a partial fix, but it's proving to
be too intrusive for the freeze period.  Will fix after the merge into mainline.

Compile the following with -O2 (adapted from fortran/scanner.c:next_char)


struct A
{
  char *nextc;
  float b;
};
 
void
bar (float *p)
{
  *p = 5.2;
}
 
char *
foo(struct A *locp, int i, char *str)
{
  float f, g, *p;
  char *T355;
  char **T356;
 
  /* Currently, the alias analyzer has limited support for handling
     aliases of structure fields when no other variables are aliased.
     Introduce additional aliases to confuse it.  */
  p =  i ? &g : &f;
  bar (p);
  if (*p > 0.0)
    str = "abc";
 
  T355 = locp->nextc;
  T356 = &locp->nextc;
  *T356 = str;
  T355 = locp->nextc;
 
  return T355;
}
 
main ()
{
  struct A loc;
  char *str;
 
  loc.nextc = "123";
  str = foo (&loc, 10, "xyz");
  if (str[0] != 'a' || str[1] != 'b' || str[2] != 'c' || str[3] != '\0')
    abort ();
  return 0;
}

-- 
           Summary: [tree-ssa] Alias analyzer cannot handle addressable
                    fields
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: dnovillo at gcc dot gnu dot org
        ReportedBy: dnovillo at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2004-09-14 23:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-03 14:22 [Bug optimization/15262] New: [tree-ssa] Alias analyzer cannot handle addressable fields dnovillo at gcc dot gnu dot org
2004-05-03 14:47 ` [Bug optimization/15262] " pinskia at gcc dot gnu dot org
2004-05-03 14:51   ` Diego Novillo
2004-05-03 14:50 ` pinskia at gcc dot gnu dot org
2004-05-03 14:51 ` dnovillo at redhat dot com
2004-05-03 14:54 ` dnovillo at redhat dot com
2004-05-03 15:01 ` pinskia at gcc dot gnu dot org
2004-05-03 15:32 ` pinskia at gcc dot gnu dot org
2004-05-03 15:35 ` pinskia at gcc dot gnu dot org
2004-05-03 15:47 ` dnovillo at redhat dot com
2004-08-23  3:12 ` [Bug tree-optimization/15262] [3.5 Regression] " cvs-commit at gcc dot gnu dot org
2004-08-23  3:17 ` pinskia at gcc dot gnu dot org
2004-08-23  4:02 ` cvs-commit at gcc dot gnu dot org
2004-09-14 12:02 ` [Bug tree-optimization/15262] [4.0 " dnovillo at gcc dot gnu dot org
2004-09-14 21:47 ` pinskia at gcc dot gnu dot org
2004-09-14 22:46 ` cvs-commit at gcc dot gnu dot org
2004-09-14 22:58 ` dnovillo at gcc dot gnu dot org
2004-09-14 23:11 ` dnovillo 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).