This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30819] php 5.2.1 / gcc 4.1.1 / solaris 2.9 / 64 bit
- From: "gcc at troy dot rollo dot name" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Mar 2007 03:51:17 -0000
- Subject: [Bug c/30819] php 5.2.1 / gcc 4.1.1 / solaris 2.9 / 64 bit
- References: <bug-30819-14084@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #34 from gcc at troy dot rollo dot name 2007-03-06 03:51 -------
The problem looks like a bug in GCC's optimisation in 4.1.1 - for the following
code:
152 while (--delete_count>=0) {
153 zval *q = *(zval **)(--p);
154 *p = NULL;
(gdb) l
155 zval_ptr_dtor(&q);
156 }
157 EG(argument_stack).top_element = p;
('p' is declared as void **)
it is producing:
add %fp, -20, %l3
L1 clr %g1
add %l0, -4, %l0
st %g1, [ %fp + -20 ]
clr [ %l0 ]
call 0x261ea4 <_zval_ptr_dtor>
mov %l3, %o0
inc %l1
cmp %l2, %l1
bne L1
%l0 contains the pointer "p". %l3 contains &q (q is at %fp-20).
Notice that %g1 (which is set to 0 at L1) is always being stored
in "q".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30819