mirror of git://gcc.gnu.org/git/gcc.git
cselib.c (expand_loc): Return sp, fp, hfp or cfa base reg right away if seen.
* cselib.c (expand_loc): Return sp, fp, hfp or cfa base reg right away if seen. From-SVN: r184169
This commit is contained in:
parent
4228697645
commit
67b977ada8
|
@ -1,5 +1,8 @@
|
||||||
2012-02-13 Jakub Jelinek <jakub@redhat.com>
|
2012-02-13 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* cselib.c (expand_loc): Return sp, fp, hfp or cfa base reg right
|
||||||
|
away if seen.
|
||||||
|
|
||||||
* cselib.c (dump_cselib_val): Don't assume l->setting_insn is
|
* cselib.c (dump_cselib_val): Don't assume l->setting_insn is
|
||||||
non-NULL.
|
non-NULL.
|
||||||
|
|
||||||
|
|
12
gcc/cselib.c
12
gcc/cselib.c
|
@ -1372,8 +1372,18 @@ expand_loc (struct elt_loc_list *p, struct expand_value_data *evd,
|
||||||
unsigned int regno = UINT_MAX;
|
unsigned int regno = UINT_MAX;
|
||||||
struct elt_loc_list *p_in = p;
|
struct elt_loc_list *p_in = p;
|
||||||
|
|
||||||
for (; p; p = p -> next)
|
for (; p; p = p->next)
|
||||||
{
|
{
|
||||||
|
/* Return these right away to avoid returning stack pointer based
|
||||||
|
expressions for frame pointer and vice versa, which is something
|
||||||
|
that would confuse DSE. See the comment in cselib_expand_value_rtx_1
|
||||||
|
for more details. */
|
||||||
|
if (REG_P (p->loc)
|
||||||
|
&& (REGNO (p->loc) == STACK_POINTER_REGNUM
|
||||||
|
|| REGNO (p->loc) == FRAME_POINTER_REGNUM
|
||||||
|
|| REGNO (p->loc) == HARD_FRAME_POINTER_REGNUM
|
||||||
|
|| REGNO (p->loc) == cfa_base_preserved_regno))
|
||||||
|
return p->loc;
|
||||||
/* Avoid infinite recursion trying to expand a reg into a
|
/* Avoid infinite recursion trying to expand a reg into a
|
||||||
the same reg. */
|
the same reg. */
|
||||||
if ((REG_P (p->loc))
|
if ((REG_P (p->loc))
|
||||||
|
|
Loading…
Reference in New Issue