public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13146] New: inheritance for nonoverlapping_component_refs_p
@ 2003-11-20 22:24 dann at godzilla dot ics dot uci dot edu
  2003-11-25  1:00 ` [Bug c++/13146] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2003-11-20 22:24 UTC (permalink / raw)
  To: gcc-bugs

Currently g++ cannot tell that accesses to class members from different points
of the inheritance hierachy cannot overlap. 

There is a patch that fixes the problem at:

http://gcc.gnu.org/ml/gcc-patches/2002-05/msg01996.html

but it seems that has been forgotten. This bug was created so that the issue 
is not completely forgotten.

A testcase is below. It would be nice if a C++ specialist would 
add more tests.

/* { dg-do link } */

class first
{
public:
  double d;
  int f1;
};

class middle : public first
{
};

class second : public middle
{
public:
  int f2;
  short a;
};

class third
{
public:
  char a;
  char b;
};

class multi: public third, public second
{
public:
  short s;
  char f3;
};

extern void link_error ();

void
foo (first *s1, second *s2)
{
  s1->f1 = 0;
  s2->f2 = 0;
  s1->f1++;
  s2->f2++;
  s1->f1++;
  s2->f2++;
  if (s1->f1 != 2)
    link_error ();
}

void
bar (first *s1, multi *s3)
{
  s1->f1 = 0;
  s3->f3 = 0;
  s1->f1++;
  s3->f3++;
  s1->f1++;
  s3->f3++;
  if (s1->f1 != 2)
    link_error ();
}


int
main()
{
  first a;
  second b;
  multi c;
  foo (&a, &b);
  bar (&a, &c);
  return 0;
}

-- 
           Summary: inheritance for nonoverlapping_component_refs_p
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        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=13146


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

* [Bug c++/13146] inheritance for nonoverlapping_component_refs_p
  2003-11-20 22:24 [Bug c++/13146] New: inheritance for nonoverlapping_component_refs_p dann at godzilla dot ics dot uci dot edu
@ 2003-11-25  1:00 ` pinskia at gcc dot gnu dot org
  2003-12-26  3:00 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-25  1:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-25 01:00 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |pessimizes-code
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-25 01:00:51
               date|                            |


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


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

* [Bug c++/13146] inheritance for nonoverlapping_component_refs_p
  2003-11-20 22:24 [Bug c++/13146] New: inheritance for nonoverlapping_component_refs_p dann at godzilla dot ics dot uci dot edu
  2003-11-25  1:00 ` [Bug c++/13146] " pinskia at gcc dot gnu dot org
@ 2003-12-26  3:00 ` pinskia at gcc dot gnu dot org
  2004-01-19 21:28 ` dhazeghi at yahoo dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-26  3:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-26 02:30 -------
There was a recent discussion about this.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug c++/13146] inheritance for nonoverlapping_component_refs_p
  2003-11-20 22:24 [Bug c++/13146] New: inheritance for nonoverlapping_component_refs_p dann at godzilla dot ics dot uci dot edu
  2003-11-25  1:00 ` [Bug c++/13146] " pinskia at gcc dot gnu dot org
  2003-12-26  3:00 ` pinskia at gcc dot gnu dot org
@ 2004-01-19 21:28 ` dhazeghi at yahoo dot com
  2004-07-03  2:37 ` giovannibajo at libero dot it
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dhazeghi at yahoo dot com @ 2004-01-19 21:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dhazeghi at yahoo dot com  2004-01-19 21:28 -------
Would anybody like to volunteer to check Richard's patch?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at redhat dot com


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


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

* [Bug c++/13146] inheritance for nonoverlapping_component_refs_p
  2003-11-20 22:24 [Bug c++/13146] New: inheritance for nonoverlapping_component_refs_p dann at godzilla dot ics dot uci dot edu
                   ` (2 preceding siblings ...)
  2004-01-19 21:28 ` dhazeghi at yahoo dot com
@ 2004-07-03  2:37 ` giovannibajo at libero dot it
  2004-10-28 20:23 ` dnovillo at gcc dot gnu dot org
  2005-01-27  2:17 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-03  2:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-07-03 02:37 -------
RTH: I think your patch linked here is not good anymore. Or at least, we want 
this done on the tree level rather than RTL. Is this still an aliasing bug? If 
so, maybe Diego will be willing to have a look at it.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it, dnovillo at gcc dot gnu
                   |                            |dot org


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


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

* [Bug c++/13146] inheritance for nonoverlapping_component_refs_p
  2003-11-20 22:24 [Bug c++/13146] New: inheritance for nonoverlapping_component_refs_p dann at godzilla dot ics dot uci dot edu
                   ` (3 preceding siblings ...)
  2004-07-03  2:37 ` giovannibajo at libero dot it
@ 2004-10-28 20:23 ` dnovillo at gcc dot gnu dot org
  2005-01-27  2:17 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-10-28 20:23 UTC (permalink / raw)
  To: gcc-bugs


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

The tree alias analyzer depends on the type information given to it by alias.c.
 In this case, the types of the pointers passed to the two routines have
conflicting alias sets, so they are given the same memory tag.

Without context sensitive information, we cannot tell where these arguments are
really pointing to, so we have to base the analysis exclusively on types. 
Notice, however, that the analysis DTRT when the calls are inlined.

-- 


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


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

* [Bug c++/13146] inheritance for nonoverlapping_component_refs_p
  2003-11-20 22:24 [Bug c++/13146] New: inheritance for nonoverlapping_component_refs_p dann at godzilla dot ics dot uci dot edu
                   ` (4 preceding siblings ...)
  2004-10-28 20:23 ` dnovillo at gcc dot gnu dot org
@ 2005-01-27  2:17 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-27  2:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-27 02:17 -------
Also it sounds like the scheduler still needs support from the rtl aliasing mechanism is helped by more 
information.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2004-10-03 16:32:42         |2005-01-27 02:17:43
               date|                            |


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


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

end of thread, other threads:[~2005-01-27  2:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-20 22:24 [Bug c++/13146] New: inheritance for nonoverlapping_component_refs_p dann at godzilla dot ics dot uci dot edu
2003-11-25  1:00 ` [Bug c++/13146] " pinskia at gcc dot gnu dot org
2003-12-26  3:00 ` pinskia at gcc dot gnu dot org
2004-01-19 21:28 ` dhazeghi at yahoo dot com
2004-07-03  2:37 ` giovannibajo at libero dot it
2004-10-28 20:23 ` dnovillo at gcc dot gnu dot org
2005-01-27  2:17 ` pinskia 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).