This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11240] Pointer comparison problem when using constructors


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]