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 target/23774] dealloc of dynamic stack space breaks backchain


------- Additional Comments From amodra at bigpond dot net dot au  2005-09-13 00:33 -------
The same thing happens with __builtin_longjmp, eg. extracted from
gcc.c-torture/execute/builtins/lib/chk.c

void __attribute__((noreturn))
__chk_fail (void)
{
  if (chk_fail_allowed)
    __builtin_longjmp (chk_fail_buf, 1);
  abort ();
}

generates

__chk_fail:
	stwu 1,-16(1)
	mflr 0
	stw 31,12(1)
	stw 0,20(1)
	mr 31,1
	lis 9,chk_fail_allowed@ha
	lwz 0,chk_fail_allowed@l(9)
	cmpwi 7,0,0
	beq- 7,.L133
	lis 11,chk_fail_buf@ha
	la 9,chk_fail_buf@l(11)
	lwz 0,4(9)
	mtctr 0
	lwz 31,chk_fail_buf@l(11)
	lwz 0,8(9)
	lwz 1,12(9)            <- stack adjusted
	stw 0,0(1)             <- backchain written
	bctr


-- 


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


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