This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11240] Pointer comparison problem when using constructors
- From: "nathan at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jan 2004 14:23:21 -0000
- Subject: [Bug c++/11240] Pointer comparison problem when using constructors
- References: <20030618145210.11240.ysbeer@af.org.za>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From nathan at gcc dot gnu dot org 2004-01-05 14:23 -------
yow! Wolfgang's example is the best. Here is the broken assembler I get with
gcc 3.2
main:
.LFB1:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
subl $8, %esp
.LCFI2:
andl $-16, %esp
movl $0, %eax
subl %eax, %esp
movw .LC0, %ax ; get initial value for s
movw %ax, -2(%ebp) ; and store it into s
subl $8, %esp
pushl $.LC0 ;; push address of string in .rodata
;; wrong! should be leal -2(%ebp),%eax;push %eax
leal -8(%ebp), %eax ;; place to create r1
pushl %eax ;; push this pointer
.LCFI3:
call _ZN2R1C1EPKc ;; construct an R1
this could be a bug in cc1plus's 'decl_constant_value' function,
anyone care to take a look?
--
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2004-01-01 02:37:29 |2004-01-05 14:23:20
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11240