public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18378] New: ICE when returning a copy of a packed member
@ 2004-11-08 17:23 jdboyer at mediatrix dot com
  2004-11-08 18:04 ` [Bug c++/18378] [3.4/4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jdboyer at mediatrix dot com @ 2004-11-08 17:23 UTC (permalink / raw)
  To: gcc-bugs

Defining a class method which returns a copy of one of its members, and this 
member is declared "packed", and this member is from another class type, causes 
an internal compiler error when this method is called.

The bug was verified on both gcc 3.4.2 and 3.4.3, on i686-linux and powerpc-
linux.

The following simple program will crash g++ when compiled with -DSHOW_ICE.

---------------------------------------------------------------------------

class A
{
public:
    int i;

    A() {}
    A(const A& a) { i = a.i; }
};

class B
{
#ifdef SHOW_ICE
    A a __attribute__((packed));
#else
    A a;
#endif

public:
    B() {}
    A GetA() { return a; }
};

int main()
{
    B b;
    return b.GetA().i;
}

---------------------------------------------------------------------------

Jean-Denis Boyer,
Mediatrix Telecom Inc.

-- 
           Summary: ICE when returning a copy of a packed member
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jdboyer at mediatrix dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-07-28 10:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-08 17:23 [Bug c++/18378] New: ICE when returning a copy of a packed member jdboyer at mediatrix dot com
2004-11-08 18:04 ` [Bug c++/18378] [3.4/4.0 Regression] " pinskia at gcc dot gnu dot org
2004-11-08 18:15 ` pinskia at gcc dot gnu dot org
2004-11-25 22:25 ` pinskia at gcc dot gnu dot org
2004-11-25 23:33 ` giovannibajo at libero dot it
2004-12-21 21:20 ` mmitchel at gcc dot gnu dot org
2004-12-22  3:35 ` cvs-commit at gcc dot gnu dot org
2004-12-22  3:39 ` [Bug c++/18378] [3.4 " mmitchel at gcc dot gnu dot org
2005-04-13 12:07 ` reichelt at gcc dot gnu dot org
2005-05-19 17:44 ` mmitchel at gcc dot gnu dot org
2005-07-28 10:25 ` cvs-commit at gcc dot gnu dot org
2005-07-28 10:26 ` giovannibajo at libero dot it

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