public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dnovillo at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug optimization/15262] New: [tree-ssa] Alias analyzer cannot handle addressable fields
Date: Mon, 03 May 2004 14:22:00 -0000	[thread overview]
Message-ID: <20040503142200.15262.dnovillo@gcc.gnu.org> (raw)

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


             reply	other threads:[~2004-05-03 14:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-03 14:22 dnovillo at gcc dot gnu dot org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040503142200.15262.dnovillo@gcc.gnu.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).