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
d614335f
Commit
d614335f
authored
Oct 30, 2015
by
Anatoly Sokolov
Committed by
Anatoly Sokolov
Oct 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add contains_symbol_ref_p
From-SVN: r229607
parent
a6906c80
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
67 deletions
+28
-67
gcc/ChangeLog
+10
-0
gcc/lra-constraints.c
+0
-29
gcc/rtl.h
+4
-0
gcc/rtlanal.c
+13
-0
gcc/var-tracking.c
+1
-38
No files found.
gcc/ChangeLog
View file @
d614335f
2015
-
10
-
30
Anatoly
Sokolov
<
aesok
@
post
.
ru
>
*
rtl
.
h
(
contains_symbol_ref_p
):
Declare
.
(
SYMBOL_REF_P
):
Define
.
*
rtlanal
.
c
(
contains_symbol_ref_p
:
New
function
.
*
lra
-
constraints
.
c
(
contains_symbol_ref_p
):
Remove
.
*
var
-
tracking
.
c
(
contains_symbol_ref
):
Remove
.
(
track_expr_p
):
Use
contains_symbol_ref_p
instead
of
contains_symbol_ref
.
2015
-
10
-
30
Alan
Lawrence
<
alan
.
lawrence
@
arm
.
com
>
2015
-
10
-
30
Alan
Lawrence
<
alan
.
lawrence
@
arm
.
com
>
*
gimple
-
fold
.
c
(
fold_array_ctor_reference
):
Move
searching
code
to
:
*
gimple
-
fold
.
c
(
fold_array_ctor_reference
):
Move
searching
code
to
:
gcc/lra-constraints.c
View file @
d614335f
...
@@ -4001,35 +4001,6 @@ contains_reg_p (rtx x, bool hard_reg_p, bool spilled_p)
...
@@ -4001,35 +4001,6 @@ contains_reg_p (rtx x, bool hard_reg_p, bool spilled_p)
return
false
;
return
false
;
}
}
/* Return true if X contains a symbol reg. */
static
bool
contains_symbol_ref_p
(
rtx
x
)
{
int
i
,
j
;
const
char
*
fmt
;
enum
rtx_code
code
;
code
=
GET_CODE
(
x
);
if
(
code
==
SYMBOL_REF
)
return
true
;
fmt
=
GET_RTX_FORMAT
(
code
);
for
(
i
=
GET_RTX_LENGTH
(
code
)
-
1
;
i
>=
0
;
i
--
)
{
if
(
fmt
[
i
]
==
'e'
)
{
if
(
contains_symbol_ref_p
(
XEXP
(
x
,
i
)))
return
true
;
}
else
if
(
fmt
[
i
]
==
'E'
)
{
for
(
j
=
XVECLEN
(
x
,
i
)
-
1
;
j
>=
0
;
j
--
)
if
(
contains_symbol_ref_p
(
XVECEXP
(
x
,
i
,
j
)))
return
true
;
}
}
return
false
;
}
/* Process all regs in location *LOC and change them on equivalent
/* Process all regs in location *LOC and change them on equivalent
substitution. Return true if any change was done. */
substitution. Return true if any change was done. */
static
bool
static
bool
...
...
gcc/rtl.h
View file @
d614335f
...
@@ -829,6 +829,9 @@ struct GTY(()) rtvec_def {
...
@@ -829,6 +829,9 @@ struct GTY(()) rtvec_def {
/* Predicate yielding nonzero iff RTX is a subreg. */
/* Predicate yielding nonzero iff RTX is a subreg. */
#define SUBREG_P(RTX) (GET_CODE (RTX) == SUBREG)
#define SUBREG_P(RTX) (GET_CODE (RTX) == SUBREG)
/* Predicate yielding true iff RTX is a symbol ref. */
#define SYMBOL_REF_P(RTX) (GET_CODE (RTX) == SYMBOL_REF)
template
<>
template
<>
template
<>
template
<>
inline
bool
inline
bool
...
@@ -2926,6 +2929,7 @@ extern void set_insn_deleted (rtx);
...
@@ -2926,6 +2929,7 @@ extern void set_insn_deleted (rtx);
/* Functions in rtlanal.c */
/* Functions in rtlanal.c */
extern
rtx
single_set_2
(
const
rtx_insn
*
,
const_rtx
);
extern
rtx
single_set_2
(
const
rtx_insn
*
,
const_rtx
);
extern
bool
contains_symbol_ref_p
(
const_rtx
);
/* Handle the cheap and common cases inline for performance. */
/* Handle the cheap and common cases inline for performance. */
...
...
gcc/rtlanal.c
View file @
d614335f
...
@@ -6230,6 +6230,19 @@ get_index_code (const struct address_info *info)
...
@@ -6230,6 +6230,19 @@ get_index_code (const struct address_info *info)
return
SCRATCH
;
return
SCRATCH
;
}
}
/* Return true if RTL X contains a SYMBOL_REF. */
bool
contains_symbol_ref_p
(
const_rtx
x
)
{
subrtx_iterator
::
array_type
array
;
FOR_EACH_SUBRTX
(
iter
,
array
,
x
,
ALL
)
if
(
SYMBOL_REF_P
(
*
iter
))
return
true
;
return
false
;
}
/* Return true if X contains a thread-local symbol. */
/* Return true if X contains a thread-local symbol. */
bool
bool
...
...
gcc/var-tracking.c
View file @
d614335f
...
@@ -664,7 +664,6 @@ static bool variable_different_p (variable *, variable *);
...
@@ -664,7 +664,6 @@ static bool variable_different_p (variable *, variable *);
static
bool
dataflow_set_different
(
dataflow_set
*
,
dataflow_set
*
);
static
bool
dataflow_set_different
(
dataflow_set
*
,
dataflow_set
*
);
static
void
dataflow_set_destroy
(
dataflow_set
*
);
static
void
dataflow_set_destroy
(
dataflow_set
*
);
static
bool
contains_symbol_ref
(
rtx
);
static
bool
track_expr_p
(
tree
,
bool
);
static
bool
track_expr_p
(
tree
,
bool
);
static
bool
same_variable_part_p
(
rtx
,
tree
,
HOST_WIDE_INT
);
static
bool
same_variable_part_p
(
rtx
,
tree
,
HOST_WIDE_INT
);
static
void
add_uses_1
(
rtx
*
,
void
*
);
static
void
add_uses_1
(
rtx
*
,
void
*
);
...
@@ -5021,42 +5020,6 @@ dataflow_set_destroy (dataflow_set *set)
...
@@ -5021,42 +5020,6 @@ dataflow_set_destroy (dataflow_set *set)
set
->
vars
=
NULL
;
set
->
vars
=
NULL
;
}
}
/* Return true if RTL X contains a SYMBOL_REF. */
static
bool
contains_symbol_ref
(
rtx
x
)
{
const
char
*
fmt
;
RTX_CODE
code
;
int
i
;
if
(
!
x
)
return
false
;
code
=
GET_CODE
(
x
);
if
(
code
==
SYMBOL_REF
)
return
true
;
fmt
=
GET_RTX_FORMAT
(
code
);
for
(
i
=
GET_RTX_LENGTH
(
code
)
-
1
;
i
>=
0
;
i
--
)
{
if
(
fmt
[
i
]
==
'e'
)
{
if
(
contains_symbol_ref
(
XEXP
(
x
,
i
)))
return
true
;
}
else
if
(
fmt
[
i
]
==
'E'
)
{
int
j
;
for
(
j
=
0
;
j
<
XVECLEN
(
x
,
i
);
j
++
)
if
(
contains_symbol_ref
(
XVECEXP
(
x
,
i
,
j
)))
return
true
;
}
}
return
false
;
}
/* Shall EXPR be tracked? */
/* Shall EXPR be tracked? */
static
bool
static
bool
...
@@ -5137,7 +5100,7 @@ track_expr_p (tree expr, bool need_rtl)
...
@@ -5137,7 +5100,7 @@ track_expr_p (tree expr, bool need_rtl)
char **_dl_argv;
char **_dl_argv;
*/
*/
if
(
decl_rtl
&&
MEM_P
(
decl_rtl
)
if
(
decl_rtl
&&
MEM_P
(
decl_rtl
)
&&
contains_symbol_ref
(
XEXP
(
decl_rtl
,
0
)))
&&
contains_symbol_ref
_p
(
XEXP
(
decl_rtl
,
0
)))
return
0
;
return
0
;
/* If RTX is a memory it should not be very large (because it would be
/* If RTX is a memory it should not be very large (because it would be
...
...
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