Skip to content

Commit

Permalink
Merged / updated old alias.c patch; current testcase is
Browse files Browse the repository at this point in the history
gcc.dg/torture/stackalign/vararg-1.c  -O2
(and higher optimization levels, too).

(orig date 2009-09-23)
2013-07-30  Joern Rennecke <joern.rennecke@embecosm.com>

        * alias.c (base_alias_check): Allow for aliases between stack-
        and frame-pointer referenced memory.

git-svn-id: svn+ssh://thomas.embecosm.com/embecosm/Customer-Projects/adapteva/branches/epiphany-20120120@2349 8ad889b4-764b-0410-b193-d8a7b30fb157

Conflicts:
	gcc/ChangeLog.epiphany
	gcc/alias.c
  • Loading branch information
amylaar committed Jul 30, 2013
1 parent be9ae52 commit 6d1194a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gcc/ChangeLog.epiphany
@@ -1,3 +1,8 @@
2013-07-30 Joern Rennecke <joern.rennecke@embecosm.com>

* alias.c (base_alias_check): Allow for aliases between stack-
and frame-pointer referenced memory.

2013-07-29 Joern Rennecke <joern.rennecke@embecosm.com>
merged from trunk:

Expand Down
12 changes: 12 additions & 0 deletions gcc/alias.c
Expand Up @@ -190,6 +190,7 @@ static void memory_modified_1 (rtx, const_rtx, void *);
Each of these rtxes has a separate ADDRESS associated with it,
each with a negative id.
Before register elimination / prologue/epilogue generation,
GCC is (and is required to be) precise in which register it
chooses to access a particular region of stack. We can therefore
assume that accesses based on one of these rtxes do not alias
Expand Down Expand Up @@ -1794,6 +1795,17 @@ base_alias_check (rtx x, rtx y, enum machine_mode x_mode,
if (GET_CODE (x_base) != ADDRESS && GET_CODE (y_base) != ADDRESS)
return 0;

/* If both are stack references, one via the stack pointer, the other via
the frame pointer, there can be an alias.
E.g.: gcc.c-torture/execute/20041113-1.c -O3 -g,
gcc.dg/torture/stackalign/vararg-1.c -O2 */
if (reload_completed
&& (x_base == static_reg_base_value[STACK_POINTER_REGNUM]
|| x_base == static_reg_base_value[HARD_FRAME_POINTER_REGNUM])
&& (y_base == static_reg_base_value[STACK_POINTER_REGNUM]
|| y_base == static_reg_base_value[HARD_FRAME_POINTER_REGNUM]))
return 1;

if (unique_base_value_p (x_base) || unique_base_value_p (y_base))
return 0;

Expand Down

0 comments on commit 6d1194a

Please sign in to comment.