This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/22051] [4.0/4.1 regression] Wrong code for function pointer comparision during optimization
- From: "tausq at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jun 2005 16:24:01 -0000
- Subject: [Bug middle-end/22051] [4.0/4.1 regression] Wrong code for function pointer comparision during optimization
- References: <20050613161424.22051.tausq@debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tausq at debian dot org 2005-06-13 16:23 -------
this is what you get with gcc-3.3:
.LC0:
.stringz"main"
.section .rodata.cst4,"aM",@progbits,4
.align 4
.LC1:
.word P%main
[...]
ldil LR'.LC0,%r25
ldi -1,%r4
bl dlsym,%r2
ldo RR'.LC0(%r25),%r25
comib,= 0,%r28,.L1
copy %r28,%r26
bl __canonicalize_funcptr_for_compare,%r2
nop
ldil LR'.LC1,%r19
copy %r28,%r4
bl __canonicalize_funcptr_for_compare,%r2
ldw RR'.LC1(%r19),%r26
comclr,= %r28,%r4,%r4
ldi 1,%r4
.L1:
copy %r4,%r28
And with gcc-4.0, you get instead:
.LC0:
.stringz"main"
.section .rodata.cst4,"aM",@progbits,4
.align 4
.LC1:
.word P%main
[...]
ldil LR'.LC0,%r25
bl dlsym,%r2
ldo RR'.LC0(%r25),%r25
movb,= %r28,%r20,.L4
ldi -1,%r19
ldil LR'.LC1,%r28
ldw RR'.LC1(%r28),%r19
comclr,= %r19,%r20,%r19
ldi 1,%r19
.L4:
copy %r19,%r28
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22051