Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
777e6976
Commit
777e6976
authored
Mar 28, 2013
by
Ian Bolton
Committed by
Ian Bolton
Mar 28, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AArch64] Only maintain frame record when required or desired
From-SVN: r197215
parent
2b24855e
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
370 additions
and
5 deletions
+370
-5
gcc/ChangeLog
+5
-0
gcc/config/aarch64/aarch64.c
+12
-5
gcc/testsuite/ChangeLog
+13
-0
gcc/testsuite/gcc.target/aarch64/asm-adder-clobber-lr.c
+48
-0
gcc/testsuite/gcc.target/aarch64/asm-adder-no-clobber-lr.c
+48
-0
gcc/testsuite/gcc.target/aarch64/test-framepointer-1.c
+30
-0
gcc/testsuite/gcc.target/aarch64/test-framepointer-2.c
+30
-0
gcc/testsuite/gcc.target/aarch64/test-framepointer-3.c
+30
-0
gcc/testsuite/gcc.target/aarch64/test-framepointer-4.c
+32
-0
gcc/testsuite/gcc.target/aarch64/test-framepointer-5.c
+30
-0
gcc/testsuite/gcc.target/aarch64/test-framepointer-6.c
+30
-0
gcc/testsuite/gcc.target/aarch64/test-framepointer-7.c
+30
-0
gcc/testsuite/gcc.target/aarch64/test-framepointer-8.c
+32
-0
No files found.
gcc/ChangeLog
View file @
777e6976
2013-03-28 Ian Bolton <ian.bolton@arm.com>
* config/aarch64/aarch64.md (aarch64_can_eliminate): Keep frame
record only when desired or required.
2013-03-28 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*vec_extract2vdi_1): Merge with
...
...
gcc/config/aarch64/aarch64.c
View file @
777e6976
...
...
@@ -3879,14 +3879,21 @@ aarch64_can_eliminate (const int from, const int to)
}
else
{
/* If we decided that we didn't need a frame pointer but then used
LR in the function, then we do need a frame pointer after all, so
prevent this elimination to ensure a frame pointer is used. */
/* If we decided that we didn't need a leaf frame pointer but then used
LR in the function, then we'll want a frame pointer after all, so
prevent this elimination to ensure a frame pointer is used.
NOTE: the original value of flag_omit_frame_pointer gets trashed
IFF flag_omit_leaf_frame_pointer is true, so we check the value
of faked_omit_frame_pointer here (which is true when we always
wish to keep non-leaf frame pointers but only wish to keep leaf frame
pointers when LR is clobbered). */
if
(
from
==
FRAME_POINTER_REGNUM
&&
to
==
STACK_POINTER_REGNUM
&&
df_regs_ever_live_p
(
LR_REGNUM
))
&&
df_regs_ever_live_p
(
LR_REGNUM
)
&&
faked_omit_frame_pointer
)
return
false
;
}
return
true
;
}
...
...
gcc/testsuite/ChangeLog
View file @
777e6976
2013-03-28 Ian Bolton <ian.bolton@arm.com>
* gcc.target/aarch64/inc/asm-adder-clobber-lr.c: New test.
* gcc.target/aarch64/inc/asm-adder-no-clobber-lr.c: Likewise.
* gcc.target/aarch64/test-framepointer-1.c: Likewise.
* gcc.target/aarch64/test-framepointer-2.c: Likewise.
* gcc.target/aarch64/test-framepointer-3.c: Likewise.
* gcc.target/aarch64/test-framepointer-4.c: Likewise.
* gcc.target/aarch64/test-framepointer-5.c: Likewise.
* gcc.target/aarch64/test-framepointer-6.c: Likewise.
* gcc.target/aarch64/test-framepointer-7.c: Likewise.
* gcc.target/aarch64/test-framepointer-8.c: Likewise.
2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56725
...
...
gcc/testsuite/gcc.target/aarch64/asm-adder-clobber-lr.c
0 → 100644
View file @
777e6976
extern
void
abort
(
void
);
int
adder
(
int
a
,
int
b
)
{
int
result
;
__asm__
(
"add %w0,%w1,%w2"
:
"=r"
(
result
)
:
"r"
(
a
),
"r"
(
b
)
:
"x30"
);
return
result
;
}
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
int
total
=
argc
;
for
(
i
=
0
;
i
<
20
;
i
++
)
total
=
adder
(
total
,
i
);
if
(
total
!=
(
190
+
argc
))
abort
();
return
0
;
}
extern
void
abort
(
void
);
int
adder
(
int
a
,
int
b
)
{
int
result
;
__asm__
(
"add %w0,%w1,%w2"
:
"=r"
(
result
)
:
"r"
(
a
),
"r"
(
b
)
:
"x30"
);
return
result
;
}
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
int
total
=
argc
;
for
(
i
=
0
;
i
<
20
;
i
++
)
total
=
adder
(
total
,
i
);
if
(
total
!=
(
190
+
argc
))
abort
();
return
0
;
}
gcc/testsuite/gcc.target/aarch64/asm-adder-no-clobber-lr.c
0 → 100644
View file @
777e6976
extern
void
abort
(
void
);
int
adder
(
int
a
,
int
b
)
{
int
result
;
__asm__
(
"add %w0,%w1,%w2"
:
"=r"
(
result
)
:
"r"
(
a
),
"r"
(
b
)
:
);
return
result
;
}
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
int
total
=
argc
;
for
(
i
=
0
;
i
<
20
;
i
++
)
total
=
adder
(
total
,
i
);
if
(
total
!=
(
190
+
argc
))
abort
();
return
0
;
}
extern
void
abort
(
void
);
int
adder
(
int
a
,
int
b
)
{
int
result
;
__asm__
(
"add %w0,%w1,%w2"
:
"=r"
(
result
)
:
"r"
(
a
),
"r"
(
b
)
:
);
return
result
;
}
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
int
total
=
argc
;
for
(
i
=
0
;
i
<
20
;
i
++
)
total
=
adder
(
total
,
i
);
if
(
total
!=
(
190
+
argc
))
abort
();
return
0
;
}
gcc/testsuite/gcc.target/aarch64/test-framepointer-1.c
0 → 100644
View file @
777e6976
/* { dg-do run } */
/* { dg-options "-O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-no-clobber-lr.c"
/* omit-frame-pointer is FALSE.
omit-leaf-frame-pointer is FALSE.
LR is not being clobbered in the leaf.
With no frame pointer omissions, we expect a frame record
for main and the leaf. */
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
/* { dg-final { cleanup-saved-temps } } */
/* { dg-do run } */
/* { dg-options "-O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-no-clobber-lr.c"
/* omit-frame-pointer is FALSE.
omit-leaf-frame-pointer is FALSE.
LR is not being clobbered in the leaf.
With no frame pointer omissions, we expect a frame record
for main and the leaf. */
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
/* { dg-final { cleanup-saved-temps } } */
gcc/testsuite/gcc.target/aarch64/test-framepointer-2.c
0 → 100644
View file @
777e6976
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-no-clobber-lr.c"
/* omit-frame-pointer is TRUE.
omit-leaf-frame-pointer is false, but irrelevant due to omit-frame-pointer.
LR is not being clobbered in the leaf.
Since we asked to have no frame pointers anywhere, we expect no frame
record in main or the leaf. */
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-no-clobber-lr.c"
/* omit-frame-pointer is TRUE.
omit-leaf-frame-pointer is false, but irrelevant due to omit-frame-pointer.
LR is not being clobbered in the leaf.
Since we asked to have no frame pointers anywhere, we expect no frame
record in main or the leaf. */
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
gcc/testsuite/gcc.target/aarch64/test-framepointer-3.c
0 → 100644
View file @
777e6976
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-no-clobber-lr.c"
/* omit-frame-pointer is TRUE.
omit-leaf-frame-pointer is true, but irrelevant due to omit-frame-pointer.
LR is not being clobbered in the leaf.
Since we asked to have no frame pointers anywhere, we expect no frame
record in main or the leaf. */
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-no-clobber-lr.c"
/* omit-frame-pointer is TRUE.
omit-leaf-frame-pointer is true, but irrelevant due to omit-frame-pointer.
LR is not being clobbered in the leaf.
Since we asked to have no frame pointers anywhere, we expect no frame
record in main or the leaf. */
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
gcc/testsuite/gcc.target/aarch64/test-framepointer-4.c
0 → 100644
View file @
777e6976
/* { dg-do run } */
/* { dg-options "-O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-no-clobber-lr.c"
/* omit-frame-pointer is FALSE.
omit-leaf-frame-pointer is TRUE.
LR is not being clobbered in the leaf.
Unless we are removing all frame records, it's OK to remove the frame
record for a leaf where LR is not clobbered. Therefore, we expect a
frame record only in main. */
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 1 } } */
/* { dg-final { cleanup-saved-temps } } */
/* { dg-do run } */
/* { dg-options "-O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-no-clobber-lr.c"
/* omit-frame-pointer is FALSE.
omit-leaf-frame-pointer is TRUE.
LR is not being clobbered in the leaf.
Unless we are removing all frame records, it's OK to remove the frame
record for a leaf where LR is not clobbered. Therefore, we expect a
frame record only in main. */
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 1 } } */
/* { dg-final { cleanup-saved-temps } } */
gcc/testsuite/gcc.target/aarch64/test-framepointer-5.c
0 → 100644
View file @
777e6976
/* { dg-do run } */
/* { dg-options "-O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-clobber-lr.c"
/* omit-frame-pointer is FALSE.
omit-leaf-frame-pointer is FALSE.
LR is being clobbered in the leaf.
With no frame pointer omissions, we expect a frame record for main
and the leaf. */
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
/* { dg-final { cleanup-saved-temps } } */
/* { dg-do run } */
/* { dg-options "-O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-clobber-lr.c"
/* omit-frame-pointer is FALSE.
omit-leaf-frame-pointer is FALSE.
LR is being clobbered in the leaf.
With no frame pointer omissions, we expect a frame record for main
and the leaf. */
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
/* { dg-final { cleanup-saved-temps } } */
gcc/testsuite/gcc.target/aarch64/test-framepointer-6.c
0 → 100644
View file @
777e6976
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-clobber-lr.c"
/* omit-frame-pointer is TRUE.
omit-leaf-frame-pointer is false, but irrelevant due to omit-frame-pointer.
LR is being clobbered in the leaf.
Since we asked to have no frame pointers anywhere, we expect no frame
record in main or the leaf. */
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-clobber-lr.c"
/* omit-frame-pointer is TRUE.
omit-leaf-frame-pointer is false, but irrelevant due to omit-frame-pointer.
LR is being clobbered in the leaf.
Since we asked to have no frame pointers anywhere, we expect no frame
record in main or the leaf. */
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
gcc/testsuite/gcc.target/aarch64/test-framepointer-7.c
0 → 100644
View file @
777e6976
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-clobber-lr.c"
/* omit-frame-pointer is TRUE.
omit-leaf-frame-pointer is true, but irrelevant due to omit-frame-pointer.
LR is being clobbered in the leaf.
Since we asked to have no frame pointers anywhere, we expect no frame
record in main or the leaf. */
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-clobber-lr.c"
/* omit-frame-pointer is TRUE.
omit-leaf-frame-pointer is true, but irrelevant due to omit-frame-pointer.
LR is being clobbered in the leaf.
Since we asked to have no frame pointers anywhere, we expect no frame
record in main or the leaf. */
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
gcc/testsuite/gcc.target/aarch64/test-framepointer-8.c
0 → 100644
View file @
777e6976
/* { dg-do run } */
/* { dg-options "-O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-clobber-lr.c"
/* omit-frame-pointer is FALSE.
omit-leaf-frame-pointer is TRUE.
LR is being clobbered in the leaf.
Unless we are removing all frame records (which we aren't), it's
not OK to remove the frame record for a leaf where LR is clobbered.
Therefore, we expect a frame record in main and leaf. */
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
/* { dg-final { cleanup-saved-temps } } */
/* { dg-do run } */
/* { dg-options "-O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
#include "asm-adder-clobber-lr.c"
/* omit-frame-pointer is FALSE.
omit-leaf-frame-pointer is TRUE.
LR is being clobbered in the leaf.
Unless we are removing all frame records (which we aren't), it's
not OK to remove the frame record for a leaf where LR is clobbered.
Therefore, we expect a frame record in main and leaf. */
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
/* { dg-final { cleanup-saved-temps } } */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment