forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR rtl-optimization/28982 * reload.c (find_reloads_address_1): Use RELOAD_OTHER for the index of a PRE_MODIFY or POST_MODIFY address. * reload1.c (inc_for_reload): Use find_replacement on the original base and index registers. gcc/testsuite/ PR rtl-optimization/28982 * gcc.c-torture/execute/pr28982a.c: New test. * gcc.c-torture/execute/pr28982b.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116919 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
rsandifo
committed
Sep 13, 2006
1 parent
dd7bdc9
commit 23c79c0
Showing
6 changed files
with
149 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
2006-09-13 Richard Sandiford <[email protected]> | ||
|
||
PR rtl-optimization/28982 | ||
* reload.c (find_reloads_address_1): Use RELOAD_OTHER for the | ||
index of a PRE_MODIFY or POST_MODIFY address. | ||
* reload1.c (inc_for_reload): Use find_replacement on the original | ||
base and index registers. | ||
|
||
2006-09-12 H.J. Lu <[email protected]> | ||
|
||
* doc/invoke.texi (mpreferred-stack-boundary): Remove exception | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
2006-09-13 Richard Sandiford <[email protected]> | ||
|
||
PR rtl-optimization/28982 | ||
* gcc.c-torture/execute/pr28982a.c: New test. | ||
* gcc.c-torture/execute/pr28982b.c: Likewise. | ||
|
||
2006-09-12 Eric Christopher <[email protected]> | ||
|
||
* gcc.target/x86_64/abi/asm-support-darwin.s: New. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* PR rtl-optimization/28982. Function foo() does the equivalent of: | ||
float tmp_results[NVARS]; | ||
for (int i = 0; i < NVARS; i++) | ||
{ | ||
int inc = incs[i]; | ||
float *ptr = ptrs[i], result = 0; | ||
for (int j = 0; j < n; j++) | ||
result += *ptr, ptr += inc; | ||
tmp_results[i] = result; | ||
} | ||
memcpy (results, tmp_results, sizeof (results)); | ||
but without the outermost loop. The idea is to create high register | ||
pressure and ensure that some INC and PTR variables are spilled. | ||
On ARM targets, sequences like "result += *ptr, ptr += inc" can | ||
usually be implemented using (mem (post_modify ...)), and we do | ||
indeed create such MEMs before reload for this testcase. However, | ||
(post_modify ...) is not a valid address for coprocessor loads, so | ||
for -mfloat-abi=softfp, reload reloads the POST_MODIFY into a base | ||
register. GCC did not deal correctly with cases where the base and | ||
index of the POST_MODIFY are themselves reloaded. */ | ||
#define NITER 4 | ||
#define NVARS 20 | ||
#define MULTI(X) \ | ||
X( 0), X( 1), X( 2), X( 3), X( 4), X( 5), X( 6), X( 7), X( 8), X( 9), \ | ||
X(10), X(11), X(12), X(13), X(14), X(15), X(16), X(17), X(18), X(19) | ||
|
||
#define DECLAREI(INDEX) inc##INDEX = incs[INDEX] | ||
#define DECLAREF(INDEX) *ptr##INDEX = ptrs[INDEX], result##INDEX = 0 | ||
#define LOOP(INDEX) result##INDEX += *ptr##INDEX, ptr##INDEX += inc##INDEX | ||
#define COPYOUT(INDEX) results[INDEX] = result##INDEX | ||
|
||
float *ptrs[NVARS]; | ||
float results[NVARS]; | ||
int incs[NVARS]; | ||
|
||
void __attribute__((noinline)) | ||
foo (int n) | ||
{ | ||
int MULTI (DECLAREI); | ||
float MULTI (DECLAREF); | ||
while (n--) | ||
MULTI (LOOP); | ||
MULTI (COPYOUT); | ||
} | ||
|
||
float input[NITER * NVARS]; | ||
|
||
int | ||
main (void) | ||
{ | ||
int i; | ||
|
||
for (i = 0; i < NVARS; i++) | ||
ptrs[i] = input + i, incs[i] = i; | ||
for (i = 0; i < NITER * NVARS; i++) | ||
input[i] = i; | ||
foo (NITER); | ||
for (i = 0; i < NVARS; i++) | ||
if (results[i] != i * NITER * (NITER + 1) / 2) | ||
return 1; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* Like pr28982a.c, but with the spill slots outside the range of | ||
a single sp-based load on ARM. This test tests for cases where | ||
the addresses in the base and index reloads require further reloads. */ | ||
#if defined(STACK_SIZE) && STACK_SIZE <= 0x80100 | ||
int main (void) { return 0; } | ||
#else | ||
#define NITER 4 | ||
#define NVARS 20 | ||
#define MULTI(X) \ | ||
X( 0), X( 1), X( 2), X( 3), X( 4), X( 5), X( 6), X( 7), X( 8), X( 9), \ | ||
X(10), X(11), X(12), X(13), X(14), X(15), X(16), X(17), X(18), X(19) | ||
|
||
#define DECLAREI(INDEX) inc##INDEX = incs[INDEX] | ||
#define DECLAREF(INDEX) *ptr##INDEX = ptrs[INDEX], result##INDEX = 0 | ||
#define LOOP(INDEX) result##INDEX += *ptr##INDEX, ptr##INDEX += inc##INDEX | ||
#define COPYOUT(INDEX) results[INDEX] = result##INDEX | ||
|
||
float *ptrs[NVARS]; | ||
float results[NVARS]; | ||
int incs[NVARS]; | ||
|
||
struct big { int i[0x10000]; }; | ||
void __attribute__((noinline)) | ||
bar (struct big b) | ||
{ | ||
incs[0] += b.i[0]; | ||
} | ||
|
||
void __attribute__((noinline)) | ||
foo (int n) | ||
{ | ||
struct big b = {}; | ||
int MULTI (DECLAREI); | ||
float MULTI (DECLAREF); | ||
while (n--) | ||
MULTI (LOOP); | ||
MULTI (COPYOUT); | ||
bar (b); | ||
} | ||
|
||
float input[NITER * NVARS]; | ||
|
||
int | ||
main (void) | ||
{ | ||
int i; | ||
|
||
for (i = 0; i < NVARS; i++) | ||
ptrs[i] = input + i, incs[i] = i; | ||
for (i = 0; i < NITER * NVARS; i++) | ||
input[i] = i; | ||
foo (NITER); | ||
for (i = 0; i < NVARS; i++) | ||
if (results[i] != i * NITER * (NITER + 1) / 2) | ||
return 1; | ||
return 0; | ||
} | ||
#endif |