This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/55672] [4.8 Regression] -fstack-check=generic ICEs in print_reg, at config/i386/i386.c:13868
- From: "vmakarov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 17 Dec 2012 21:39:28 +0000
- Subject: [Bug target/55672] [4.8 Regression] -fstack-check=generic ICEs in print_reg, at config/i386/i386.c:13868
- Auto-submitted: auto-generated
- References: <bug-55672-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55672
--- Comment #4 from Vladimir Makarov <vmakarov at gcc dot gnu.org> 2012-12-17 21:39:28 UTC ---
If stack_realign_p is true, frame_pointer_needed is also true. So we can use
fp to eliminate frame but i386.c::x86_can_eliminate prohibits it. The code
looks strange:
if (stack_realign_fp)
return ((from == ARG_POINTER_REGNUM
&& to == HARD_FRAME_POINTER_REGNUM)
|| (from == FRAME_POINTER_REGNUM
&& to == STACK_POINTER_REGNUM));
So we permit to change argument pointer but not frame pointer to FP which again
is strange IMHO. Changing the code to
if (stack_realign_fp)
return ((from == ARG_POINTER_REGNUM
&& to == HARD_FRAME_POINTER_REGNUM)
|| (from == FRAME_POINTER_REGNUM
&& to == STACK_POINTER_REGNUM)
|| (from == FRAME_POINTER_REGNUM
&& to == HARD_FRAME_POINTER_REGNUM));
solves the problem.