public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/2817
@ 2001-06-13 12:06 Franz Sirl
  0 siblings, 0 replies; 5+ messages in thread
From: Franz Sirl @ 2001-06-13 12:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/2817; it has been noted by GNATS.

From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
To: mmitchel@gcc.gnu.org,
 Franz.Sirl-kernel@lauterbach.com,
 gcc-gnats@gcc.gnu.org,
 nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/2817
Date: Wed, 13 Jun 2001 20:59:27 +0200

 On Saturday 19 May 2001 02:31, mmitchel@gcc.gnu.org wrote:
 > Synopsis: g++.abi/vtable2.C not aliasing safe?
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: mmitchel
 > State-Changed-When: Fri May 18 17:31:58 2001
 > State-Changed-Why:
 >     Please attach preprocessed source and reopen the bug.
 >
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2817&database=gcc
 
 This appears to be fixed since today, please close the report.
 
 Franz.


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

* Re: c++/2817
@ 2001-05-19 10:06 Franz Sirl
  0 siblings, 0 replies; 5+ messages in thread
From: Franz Sirl @ 2001-05-19 10:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/2817; it has been noted by GNATS.

From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
To: Mark Mitchell <mark@codesourcery.com>,
 Franz.Sirl-kernel@lauterbach.com
Cc: mmitchel@gcc.gnu.org,
 gcc-gnats@gcc.gnu.org,
 nobody@gcc.gnu.org
Subject: Re: c++/2817
Date: Sat, 19 May 2001 19:07:45 +0200

 --------------Boundary-00=_X8EL8AXX8XYK9S4EE0KL
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: 8bit
 
 On Saturday 19 May 2001 18:48, Mark Mitchell wrote:
 > >>>>> "Franz" == Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
 >
 >     Franz> Well, I think it's a bit pointless to attach sourcecode
 >     Franz> already in the testsuite, but here it is.
 >
 > The reason is that I don't have the PowerPC headers, which is where
 > ptrdiff_t will come from, which is one of the critical things for me
 > to look at the aliasing stuff.
 
 I clicked on the wrong file anyway, heres the .ii. 
 
 BTW, if you want access to the PPC developer machine, that's no problem.
 
 Franz.
 
 --------------Boundary-00=_X8EL8AXX8XYK9S4EE0KL
 Content-Type: text/plain;
   charset="iso-8859-1";
   name="vtable2.ii"
 Content-Transfer-Encoding: 8bit
 Content-Disposition: attachment; filename="vtable2.ii"
 
 # 5 "vtable2.C"
 # 1 "/usr/lib/gcc-lib/ppc-linux/3.0/include/stddef.h" 1 3
 # 147 "/usr/lib/gcc-lib/ppc-linux/3.0/include/stddef.h" 3
 typedef int ptrdiff_t;
 # 199 "/usr/lib/gcc-lib/ppc-linux/3.0/include/stddef.h" 3
 typedef unsigned int size_t;
 # 6 "vtable2.C" 2
 
 struct S0
 {
   virtual void s0 ();
 };
 
 struct S1 : virtual public S0
 {
   virtual void s1 ();
 };
 
 struct S2 : virtual public S1
 {
   virtual void s1 ();
   virtual void s0 ();
 };
 
 struct S3
 {
   virtual void s3 ();
 };
 
 struct S4 : public S3, virtual public S2
 {
   virtual void s1 ();
 };
 
 void S0::s0 ()
 {
 }
 
 void S1::s1 ()
 {
 }
 
 void S2::s1 ()
 {
 }
 
 void S2::s0 ()
 {
 }
 
 void S3::s3 ()
 {
 }
 
 void S4::s1 ()
 {
 }
 # 124 "vtable2.C"
 extern "C" {
 void _ZN2S32s3Ev ();
 void _ZN2S42s1Ev ();
 }
 
 int main ()
 {
   S4 s4;
   volatile ptrdiff_t **vptr;
   volatile ptrdiff_t *vtbl;
 
 
   vptr = (volatile ptrdiff_t **) (char*) &s4;
   vtbl = *vptr;
   vtbl -= 5;
 
   if (*vtbl++ != ((char*) (S0*) &s4) - (char*) &s4)
     return 1;
 # 175 "vtable2.C"
 }
 
 --------------Boundary-00=_X8EL8AXX8XYK9S4EE0KL--


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

* Re: c++/2817
@ 2001-05-19  9:56 Mark Mitchell
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Mitchell @ 2001-05-19  9:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/2817; it has been noted by GNATS.

From: Mark Mitchell <mark@codesourcery.com>
To: Franz.Sirl-kernel@lauterbach.com
Cc: mmitchel@gcc.gnu.org, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: c++/2817
Date: Sat, 19 May 2001 09:48:34 -0700

 >>>>> "Franz" == Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
 
     Franz> Well, I think it's a bit pointless to attach sourcecode
     Franz> already in the testsuite, but here it is.
 
 The reason is that I don't have the PowerPC headers, which is where
 ptrdiff_t will come from, which is one of the critical things for me
 to look at the aliasing stuff.
 
 --
 Mark Mitchell                   mark@codesourcery.com
 CodeSourcery, LLC               http://www.codesourcery.com


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

* Re: c++/2817
@ 2001-05-19  1:36 Franz Sirl
  0 siblings, 0 replies; 5+ messages in thread
From: Franz Sirl @ 2001-05-19  1:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/2817; it has been noted by GNATS.

From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
To: mmitchel@gcc.gnu.org,
 gcc-gnats@gcc.gnu.org,
 nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/2817
Date: Sat, 19 May 2001 10:36:08 +0200

 --------------Boundary-00=_8KQKFQFMKHLOH3TTY8CD
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: 8bit
 
 On Saturday 19 May 2001 02:31, mmitchel@gcc.gnu.org wrote:
 > Synopsis: g++.abi/vtable2.C not aliasing safe?
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: mmitchel
 > State-Changed-When: Fri May 18 17:31:58 2001
 > State-Changed-Why:
 >     Please attach preprocessed source and reopen the bug.
 >
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2817&database=gcc
 
 Well, I think it's a bit pointless to attach sourcecode already in the 
 testsuite, but here it is.
 
 Franz.
 
 
 --------------Boundary-00=_8KQKFQFMKHLOH3TTY8CD
 Content-Type: text/plain;
   charset="iso-8859-1";
   name="vtable2.C"
 Content-Transfer-Encoding: 8bit
 Content-Disposition: attachment; filename="vtable2.C"
 
 // Origin: Mark Mitchell <mark@codesourcery.com>
 
 #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
 
 #include <stddef.h>
 
 struct S0
 {
   virtual void s0 ();
 };
 
 struct S1 : virtual public S0
 {
   virtual void s1 ();
 };
 
 struct S2 : virtual public S1
 {
   virtual void s1 ();
   virtual void s0 ();
 };
 
 struct S3
 {
   virtual void s3 ();
 };
 
 struct S4 : public S3, virtual public S2
 {
   virtual void s1 ();
 };
 
 void S0::s0 ()
 {
 }
 
 void S1::s1 ()
 {
 }
 
 void S2::s1 ()
 {
 }
 
 void S2::s0 ()
 {
 }
 
 void S3::s3 ()
 {
 }
 
 void S4::s1 ()
 {
 }
 
 /* The vtables should look like:
 
    S0 primary vtable
    
      S0 offset to top
      S0 RTTI
      S0::s0
 
    =================
 
    S1 primary vtable
 
      S0::s0 vcall offset
      S0 vbase offset
      S1 offset to top
      S1 RTTI
      S0::s0
      S1::s1
 
    =================
 
    S2 primary vtable
    
      S2::s1 vcall offset
      S1 vbase offset
      S2::s0 vcall offset
      S0 vbase offset
      S2 offset to top
      S2 RTTI
      S2::s0
      S2::s1
 
    =================
 
    S3 primary vtable
 
      S3 offset to top
      S3 RTTI
      S3::s3
 
    =================
 
    S4 primary vtable
 
      vbase offset for S0
      vbase offset for S1
      vbase offset for S2
      S4 offset to top
      S4 RTTI
      S3::s3
      S4::s1
 
    S2-in-S4 secondary vtable
 
      S1 vbase offset
      S4::s1 vcall offset
      S0 vbase offset
      S2:s0 vcall offset
      S2 offset to top
      S4 RTTI
      S2::s0
      S4::s1
 
 */
 
 // These are tricks to allow us to get raw function pointers for
 // member functions.
 extern "C" {
 void _ZN2S32s3Ev ();
 void _ZN2S42s1Ev ();
 }
 
 int main ()
 {
   S4 s4;
   ptrdiff_t **vptr;
   ptrdiff_t *vtbl;
 
   // Set vtbl to point at the beginning of S4's primary vtable.
   vptr = (ptrdiff_t **) &s4;
   vtbl = *vptr;
   vtbl -= 5;
 
   if (*vtbl++ != ((char*) (S0*) &s4) - (char*) &s4)
     return 1;
   if (*vtbl++ != ((char*) (S1*) &s4) - (char*) &s4)
     return 2;
   if (*vtbl++ != ((char*) (S2*) &s4) - (char*) &s4)
     return 3;
   if (*vtbl++ != 0)
     return 4;
   // Skip the RTTI entry.
   vtbl++;
   if (*vtbl++ != (ptrdiff_t) &_ZN2S32s3Ev)
     return 5;
   if (*vtbl++ != (ptrdiff_t) &_ZN2S42s1Ev)
     return 6;
   // The S1 vbase offset.
   if (*vtbl++ != 0)
     return 7;
   // The S4::s1 vcall offset is negative; once you convert to S2, you
   // have to convert to S4 to find the final overrider.
   if (*vtbl++ != ((char*) &s4 - (char*) (S2*) &s4))
     return 8;
   if (*vtbl++ != 0)
     return 9;
   if (*vtbl++ != 0)
     return 10;
   // Now we're at the S2 offset to top entry.
   if (*vtbl++ != ((char*) &s4 - (char*) (S2*) &s4))
     return 11;
   // Skip the RTTI entry.
   vtbl++;
   // Skip the remaining virtual functions -- they are thunks.
   vtbl++;
   vtbl++;
 }
 
 #else /* !(defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100) */
 
 int main ()
 {
 }
 
 #endif /* !(defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100) */
 
 --------------Boundary-00=_8KQKFQFMKHLOH3TTY8CD--


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

* Re: c++/2817
@ 2001-05-18 17:36 mmitchel
  0 siblings, 0 replies; 5+ messages in thread
From: mmitchel @ 2001-05-18 17:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/2817; it has been noted by GNATS.

From: mmitchel@gcc.gnu.org
To: Franz.Sirl-kernel@lauterbach.com, gcc-gnats@gcc.gnu.org,
  nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/2817
Date: 19 May 2001 00:31:58 -0000

 Synopsis: g++.abi/vtable2.C not aliasing safe?
 
 State-Changed-From-To: open->feedback
 State-Changed-By: mmitchel
 State-Changed-When: Fri May 18 17:31:58 2001
 State-Changed-Why:
     Please attach preprocessed source and reopen the bug.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2817&database=gcc


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

end of thread, other threads:[~2001-06-13 12:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-13 12:06 c++/2817 Franz Sirl
  -- strict thread matches above, loose matches on Subject: below --
2001-05-19 10:06 c++/2817 Franz Sirl
2001-05-19  9:56 c++/2817 Mark Mitchell
2001-05-19  1:36 c++/2817 Franz Sirl
2001-05-18 17:36 c++/2817 mmitchel

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