https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84538
--- Comment #5 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- Author: rsandifo Date: Thu Mar 1 08:22:06 2018 New Revision: 258094 URL: https://gcc.gnu.org/viewcvs?rev=258094&root=gcc&view=rev Log: Tighten use of HARD_FRAME_POINTER_REGNUM in alias.c (PR 84538) RTL code needs to be consistent about whether it uses the stack pointer, the frame pointer or the argument pointer to access a given part of the frame. alias.c used this to divide accesses into three independent areas. The problem in the PR is that we did this for HARD_FRAME_POINTER_REGNUM even when the register wasn't being used as a frame pointer. We can't do that because the frame pointer is then just any old allocatable register and could certainly point to info accessed through the argument pointer or stack pointer. 2018-03-01 Richard Sandiford <richard.sandif...@linaro.org> gcc/ PR rtl-optimization/84538 * alias.c (init_alias_target): Add commentary. (init_alias_analysis): Only give HARD_FRAME_POINTER_REGNUM a unique base value if the frame pointer is not eliminated to the stack pointer. gcc/testsuite/ PR rtl-optimization/84538 * gcc.dg/torture/pr84538.c: New test. Added: trunk/gcc/testsuite/gcc.dg/torture/pr84538.c Modified: trunk/gcc/ChangeLog trunk/gcc/alias.c trunk/gcc/testsuite/ChangeLog