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
3d592d2d
Commit
3d592d2d
authored
Jul 27, 2018
by
Qing Zhao
Committed by
Qing Zhao
Jul 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable strcmp/strncmp/memcmp inlining when optimization
level is lower than 2 or Os From-SVN: r263028
parent
543f1a04
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
3 deletions
+18
-3
gcc/ChangeLog
+5
-0
gcc/builtins.c
+5
-0
gcc/testsuite/ChangeLog
+5
-0
gcc/testsuite/gcc.dg/strcmpopt_5.c
+1
-1
gcc/testsuite/gcc.dg/strcmpopt_6.c
+2
-2
No files found.
gcc/ChangeLog
View file @
3d592d2d
2018-07-26 Qing Zhao <qing.zhao@oracle.com>
* builtins.c (inline_expand_builtin_string_cmp): Disable inlining
when optimization level is lower than 2 or optimize for size.
2018-07-26 Martin Sebor <msebor@redhat.com>
PR tree-optimization/86043
...
...
gcc/builtins.c
View file @
3d592d2d
...
...
@@ -6854,6 +6854,11 @@ inline_expand_builtin_string_cmp (tree exp, rtx target)
unsigned
HOST_WIDE_INT
length
=
0
;
bool
is_ncmp
=
(
fcode
==
BUILT_IN_STRNCMP
||
fcode
==
BUILT_IN_MEMCMP
);
/* Do NOT apply this inlining expansion when optimizing for size or
optimization level below 2. */
if
(
optimize
<
2
||
optimize_insn_for_size_p
())
return
NULL_RTX
;
gcc_checking_assert
(
fcode
==
BUILT_IN_STRCMP
||
fcode
==
BUILT_IN_STRNCMP
||
fcode
==
BUILT_IN_MEMCMP
);
...
...
gcc/testsuite/ChangeLog
View file @
3d592d2d
2018-07-26 Qing Zhao <qing.zhao@oracle.com>
* gcc.dg/strcmpopt_5.c: Change to O2 to enable the transformation.
* gcc.dg/strcmpopt_6.c: Likewise.
2018-07-26 Pat Haugen <pthaugen@us.ibm.com>
PR target/86612
...
...
gcc/testsuite/gcc.dg/strcmpopt_5.c
View file @
3d592d2d
/* { dg-do run } */
/* { dg-options "-O -fdump-rtl-expand" } */
/* { dg-options "-O
2
-fdump-rtl-expand" } */
typedef
struct
{
char
s
[
8
];
int
x
;
}
S
;
__attribute__
((
noinline
))
int
...
...
gcc/testsuite/gcc.dg/strcmpopt_6.c
View file @
3d592d2d
/* When the specified length exceeds one of the arguments of the call to memcmp,
the call to memcmp should NOT be inlined. */
/* { dg-do run } */
/* { dg-options "-O -fdump-rtl-expand -Wno-stringop-overflow" } */
/* { dg-options "-O
2
-fdump-rtl-expand -Wno-stringop-overflow" } */
typedef
struct
{
char
s
[
8
];
int
x
;
}
S
;
...
...
@@ -33,4 +33,4 @@ int main (void)
}
/* { dg-final { scan-rtl-dump-times "__builtin_memcmp"
4
"expand" } } */
/* { dg-final { scan-rtl-dump-times "__builtin_memcmp"
6
"expand" } } */
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