public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32716]  New: Wrong code generation. Inlining problem.
@ 2007-07-10  9:52 pranav dot bhandarkar at gmail dot com
  2007-07-10 10:02 ` [Bug c++/32716] " pranav dot bhandarkar at gmail dot com
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: pranav dot bhandarkar at gmail dot com @ 2007-07-10  9:52 UTC (permalink / raw)
  To: gcc-bugs

Generating wrong code for the following code snippet (test.C)
using namespace std;
#include <iostream>
class A { public:int a;};
class B: public virtual A { public:     A::a;};
class C : public virtual A { public:    A::a;};
class D : public C, public B {};
void h ( D &x )
{
        x.a++;
}
int main ()
{
       int result ;
        D d;
        d.a = 0;
        h (d);
        result = !(d.a==1);
        result ? cout<<"FAILED": cout <<"SUCCESS";
        return 0;
}
$>arm-none-eabi-g++ -O3 test.C
$> arm-none-eabi-run a.out
FAILED
$>arm-none-eabi-g++ -O3 test.C -fno-inline-functions
$> arm-none-eabi-run a.out
SUCCESS
$>arm-none-eabi-g++ --version
arm-none-eabi-g++ (GCC) 4.3.0 20070703 (experimental)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


-- 
           Summary: Wrong code generation. Inlining problem.
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pranav dot bhandarkar at gmail dot com
GCC target triplet: arm-none-eabi


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


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

end of thread, other threads:[~2009-03-30 22:11 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-10  9:52 [Bug c++/32716] New: Wrong code generation. Inlining problem pranav dot bhandarkar at gmail dot com
2007-07-10 10:02 ` [Bug c++/32716] " pranav dot bhandarkar at gmail dot com
2007-07-10 11:29 ` [Bug c++/32716] [4.2/4.3 Regression] Wrong code generation. Alias and C++ virtual bases problem rguenth at gcc dot gnu dot org
2007-07-10 12:52 ` rguenth at gcc dot gnu dot org
2007-07-10 15:15 ` ramana dot radhakrishnan at celunite dot com
2007-07-10 15:32 ` rguenther at suse dot de
2007-07-10 16:59 ` dberlin at dberlin dot org
2007-07-11  8:33 ` rguenther at suse dot de
2007-07-15 20:49 ` pinskia at gcc dot gnu dot org
2007-07-20  3:49 ` mmitchel at gcc dot gnu dot org
2007-08-10  0:44 ` mmitchel at gcc dot gnu dot org
2007-08-19 23:24 ` dberlin at gcc dot gnu dot org
2007-08-20  1:55 ` dberlin at gcc dot gnu dot org
2007-08-20  8:52 ` ht990332 at gmail dot com
2007-08-20  9:28 ` [Bug c++/32716] [4.2 " rguenth at gcc dot gnu dot org
2007-10-09 19:30 ` mmitchel at gcc dot gnu dot org
2008-02-01 16:59 ` jsm28 at gcc dot gnu dot org
2008-05-19 20:28 ` jsm28 at gcc dot gnu dot org
2009-01-15 10:41 ` ramana at icerasemi dot com
2009-03-30 22:11 ` jsm28 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).