public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory
@ 2003-11-11 15:38 oldfishdontdie at hotmail dot com
  2003-11-11 15:46 ` [Bug c++/13009] " oldfishdontdie at hotmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: oldfishdontdie at hotmail dot com @ 2003-11-11 15:38 UTC (permalink / raw)
  To: gcc-bugs

In a class that virtually inherits another class, the implicitly-defined 
assignment operator copies the object to the wrong location when called for an 
object of a more derived class.
The attached example, when compiled with g++-3.3.1/g++-3.3.2, prints out "cb" 
instead of "bc".

-- 
           Summary: Implicitly-defined assignment operator writes to wrong
                    memory
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: oldfishdontdie at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/13009] Implicitly-defined assignment operator writes to wrong memory
  2003-11-11 15:38 [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory oldfishdontdie at hotmail dot com
@ 2003-11-11 15:46 ` oldfishdontdie at hotmail dot com
  2003-11-11 16:29 ` [Bug c++/13009] [3.3/3.4 regression] " bangerth at dealii dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oldfishdontdie at hotmail dot com @ 2003-11-11 15:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From oldfishdontdie at hotmail dot com  2003-11-11 15:46 -------
Created an attachment (id=5115)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5115&action=view)
Code for reproducing the bug


-- 


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


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

* [Bug c++/13009] [3.3/3.4 regression] Implicitly-defined assignment operator writes to wrong memory
  2003-11-11 15:38 [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory oldfishdontdie at hotmail dot com
  2003-11-11 15:46 ` [Bug c++/13009] " oldfishdontdie at hotmail dot com
@ 2003-11-11 16:29 ` bangerth at dealii dot org
  2003-12-24 21:57 ` gdr at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bangerth at dealii dot org @ 2003-11-11 16:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2003-11-11 16:29 -------
Indeed. This is a regression in 3.3.x and mainline with respect to
previous versions.

W.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-11 16:29:08
               date|                            |
            Summary|Implicitly-defined          |[3.3/3.4 regression]
                   |assignment operator writes  |Implicitly-defined
                   |to wrong memory             |assignment operator writes
                   |                            |to wrong memory
   Target Milestone|---                         |3.3.3


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


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

* [Bug c++/13009] [3.3/3.4 regression] Implicitly-defined assignment operator writes to wrong memory
  2003-11-11 15:38 [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory oldfishdontdie at hotmail dot com
  2003-11-11 15:46 ` [Bug c++/13009] " oldfishdontdie at hotmail dot com
  2003-11-11 16:29 ` [Bug c++/13009] [3.3/3.4 regression] " bangerth at dealii dot org
@ 2003-12-24 21:57 ` gdr at gcc dot gnu dot org
  2003-12-29  2:42 ` cvs-commit at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gdr at gcc dot gnu dot org @ 2003-12-24 21:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at gcc dot gnu dot org  2003-12-24 21:54 -------
Nathan --
One more ABI issue, I beleive.

-- Gaby


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathan at codesourcery dot
                   |                            |com


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


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

* [Bug c++/13009] [3.3/3.4 regression] Implicitly-defined assignment operator writes to wrong memory
  2003-11-11 15:38 [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory oldfishdontdie at hotmail dot com
                   ` (2 preceding siblings ...)
  2003-12-24 21:57 ` gdr at gcc dot gnu dot org
@ 2003-12-29  2:42 ` cvs-commit at gcc dot gnu dot org
  2003-12-29  2:44 ` [Bug c++/13009] [3.3 " mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-29  2:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-29 01:30 -------
Subject: Bug 13009

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2003-12-29 01:30:32

Modified files:
	gcc/cp         : ChangeLog call.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/init: assign1.C 

Log message:
	PR c++/13009
	* call.c (build_special_member_call): Do not assume that we have a
	pointer to the complete object in an assignment operator.
	
	PR c++/13009
	* g++.dg/init/assign1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3836&r2=1.3837
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.446&r2=1.447
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3313&r2=1.3314
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/assign1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/13009] [3.3 regression] Implicitly-defined assignment operator writes to wrong memory
  2003-11-11 15:38 [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory oldfishdontdie at hotmail dot com
                   ` (3 preceding siblings ...)
  2003-12-29  2:42 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-29  2:44 ` mmitchel at gcc dot gnu dot org
  2004-01-01  0:17 ` gdr at integrable-solutions dot net
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2003-12-29  2:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2003-12-29 01:34 -------
Fixed in GCC 3.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[3.3/3.4 regression]        |[3.3 regression] Implicitly-
                   |Implicitly-defined          |defined assignment operator
                   |assignment operator writes  |writes to wrong memory
                   |to wrong memory             |


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


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

* [Bug c++/13009] [3.3 regression] Implicitly-defined assignment operator writes to wrong memory
  2003-11-11 15:38 [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory oldfishdontdie at hotmail dot com
                   ` (4 preceding siblings ...)
  2003-12-29  2:44 ` [Bug c++/13009] [3.3 " mmitchel at gcc dot gnu dot org
@ 2004-01-01  0:17 ` gdr at integrable-solutions dot net
  2004-01-21  3:39 ` dhazeghi at yahoo dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-01-01  0:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2004-01-01 00:17 -------
Subject: Re:  [3.3 regression] Implicitly-defined assignment operator writes to wrong memory

"mmitchel at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Fixed in GCC 3.4.

Mark,

  As the author of this patch, do you think it is eligible for 3_3-branch?
  
-- Gaby


-- 


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


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

* [Bug c++/13009] [3.3 regression] Implicitly-defined assignment operator writes to wrong memory
  2003-11-11 15:38 [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory oldfishdontdie at hotmail dot com
                   ` (5 preceding siblings ...)
  2004-01-01  0:17 ` gdr at integrable-solutions dot net
@ 2004-01-21  3:39 ` dhazeghi at yahoo dot com
  2004-01-21  5:04 ` cvs-commit at gcc dot gnu dot org
  2004-01-21  5:04 ` gdr at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: dhazeghi at yahoo dot com @ 2004-01-21  3:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dhazeghi at yahoo dot com  2004-01-21 03:39 -------
I don't think Mark is on the cc: list for this bug. FWIW the patch does apply cleanly.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at integrable-solutions
                   |                            |dot net
           Keywords|                            |patch


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


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

* [Bug c++/13009] [3.3 regression] Implicitly-defined assignment operator writes to wrong memory
  2003-11-11 15:38 [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory oldfishdontdie at hotmail dot com
                   ` (6 preceding siblings ...)
  2004-01-21  3:39 ` dhazeghi at yahoo dot com
@ 2004-01-21  5:04 ` cvs-commit at gcc dot gnu dot org
  2004-01-21  5:04 ` gdr at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-21  5:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-01-21 05:04 -------
Subject: Bug 13009

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	gdr@gcc.gnu.org	2004-01-21 05:04:06

Modified files:
	gcc/cp         : ChangeLog call.c 
Added files:
	gcc/testsuite/g++.dg/init: assign1.C 

Log message:
	Backport from mainline
	2003-12-28  Mark Mitchell  <mark@codesourcery.com>
	
	PR c++/13009
	* call.c (build_special_member_call): Do not assume that we
	have a
	pointer to the complete object in an assignment operator.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.238&r2=1.3076.2.239
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.341.2.34&r2=1.341.2.35
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/assign1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.14.1



-- 


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


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

* [Bug c++/13009] [3.3 regression] Implicitly-defined assignment operator writes to wrong memory
  2003-11-11 15:38 [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory oldfishdontdie at hotmail dot com
                   ` (7 preceding siblings ...)
  2004-01-21  5:04 ` cvs-commit at gcc dot gnu dot org
@ 2004-01-21  5:04 ` gdr at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: gdr at gcc dot gnu dot org @ 2004-01-21  5:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at gcc dot gnu dot org  2004-01-21 05:04 -------
Fixed with backport from mainline.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2004-01-21  5:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-11 15:38 [Bug c++/13009] New: Implicitly-defined assignment operator writes to wrong memory oldfishdontdie at hotmail dot com
2003-11-11 15:46 ` [Bug c++/13009] " oldfishdontdie at hotmail dot com
2003-11-11 16:29 ` [Bug c++/13009] [3.3/3.4 regression] " bangerth at dealii dot org
2003-12-24 21:57 ` gdr at gcc dot gnu dot org
2003-12-29  2:42 ` cvs-commit at gcc dot gnu dot org
2003-12-29  2:44 ` [Bug c++/13009] [3.3 " mmitchel at gcc dot gnu dot org
2004-01-01  0:17 ` gdr at integrable-solutions dot net
2004-01-21  3:39 ` dhazeghi at yahoo dot com
2004-01-21  5:04 ` cvs-commit at gcc dot gnu dot org
2004-01-21  5:04 ` gdr 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).