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
4803a34a
Commit
4803a34a
authored
May 22, 1992
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r1057
parent
af189bf3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
69 deletions
+115
-69
gcc/Makefile.in
+13
-10
gcc/c-decl.c
+2
-0
gcc/combine.c
+46
-25
gcc/reload.c
+53
-33
gcc/reload1.c
+1
-1
No files found.
gcc/Makefile.in
View file @
4803a34a
...
...
@@ -1148,26 +1148,27 @@ SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES)
-
rm
-f
SYSCALLS.c
test-protoize-simple
:
./protoize ./unprotoize $(GCC_PASSES)
-
rm
-f
tmp-proto.
*
-
rm
-f
tmp-proto.
[cso]
cp
$(srcdir)
/protoize.c tmp-proto.c
chmod u+w tmp-proto.c
./protoize
-N
-B
./
-
c
"-B./ -Wall -Wwrite-strings
$(CFLAGS)
\
$(INCLUDES)
\
./protoize
-N
-B
./
-
x
getopt.h
-c
"-B./ -Wall -Wwrite-strings
\
$(
CFLAGS)
$(
INCLUDES)
\
-DGCC_INCLUDE_DIR=0
\
-DGPLUSPLUS_INCLUDE_DIR=0
\
-DCROSS_INCLUDE_DIR=0
\
-DSTD_PROTO_DIR=0"
tmp-proto.c
@
echo
Expect 324 lines of differences.
diff
$(srcdir)
/protoize.c tmp-proto.c | wc
-l
./unprotoize
-N
-c
"-B./ -Wall -Wwrite-strings
$(CFLAGS)
\
$(INCLUDES)
\
@
echo
'**********'
Expect 402 lines of differences.
-
diff
$(srcdir)
/protoize.c tmp-proto.c
>
tmp-proto.diff
-
wc
-l
tmp-proto.diff
./unprotoize
-N
-x
getopt.h
-c
"-B./ -Wall -Wwrite-strings
\
$(CFLAGS)
$(INCLUDES)
\
-DGCC_INCLUDE_DIR=0
\
-DGPLUSPLUS_INCLUDE_DIR=0
\
-DCROSS_INCLUDE_DIR=0
\
-DSTD_PROTO_DIR=0"
tmp-proto.c
@
echo
Expect zero differences.
diff
$(srcdir)
/protoize.c tmp-proto.c |
cat
-
rm
-f
tmp-proto.
*
-
rm
-f
tmp-proto.
[cso]
# Remake the info files.
...
...
@@ -1203,8 +1204,8 @@ mostlyclean:
-rm
-f
tmplibgcc*
tmpcopy
for
name
in
$(LIB1FUNCS);
do
rm
-f
$${name}.c;
done
# Delete other temporary files.
-rm
-f
tmp-float.h
tmp-
*proto.1
tmp-
gcc.xtar.Z
tmp-limits.h
gccnew
-rm
-f
tmp-foo1
tmp-foo2
tmp-proto.
c
-rm
-f
tmp-float.h
tmp-gcc.xtar.Z
tmp-limits.h
gccnew
-rm
-f
tmp-foo1
tmp-foo2
tmp-proto.
*
# Delete the stamp files.
-rm
-f
stamp-*
tmp-*
# Delete debugging dump files.
...
...
@@ -1374,7 +1375,9 @@ install-common: native install-dir
ln
$(bindir)/gcc
$(bindir)/gcc-$(target)-1;
\
mv
$(bindir)/gcc-$(target)-1
$(bindir)/gcc-$(target);
\
fi
-rm
-f
$(bindir)/c++
$(INSTALL_PROGRAM)
$(srcdir)/c++
$(bindir)/c++
-rm
-f
$(bindir)/g++
$(INSTALL_PROGRAM)
$(srcdir)/g++
$(bindir)/g++
-rm
-f
$(libsubdir)/cpp
$(INSTALL_PROGRAM)
cpp
$(libsubdir)/cpp
...
...
gcc/c-decl.c
View file @
4803a34a
...
...
@@ -2617,6 +2617,7 @@ builtin_function (name, type, function_code, library_name)
char
*
name
;
tree
type
;
enum
built_in_function
function_code
;
TREE_NO_UNUSED_WARNING
(
decl
)
=
1
;
char
*
library_name
;
{
tree
decl
=
build_decl
(
FUNCTION_DECL
,
get_identifier
(
name
),
type
);
...
...
@@ -2629,6 +2630,7 @@ builtin_function (name, type, function_code, library_name)
DECL_BUILT_IN_NONANSI
(
decl
)
=
1
;
if
(
library_name
)
DECL_ASSEMBLER_NAME
(
decl
)
=
get_identifier
(
library_name
);
TREE_NO_UNUSED_WARNING
(
decl
)
=
1
;
make_decl_rtl
(
decl
,
0
,
1
);
pushdecl
(
decl
);
if
(
function_code
!=
NOT_BUILT_IN
)
...
...
gcc/combine.c
View file @
4803a34a
...
...
@@ -6572,7 +6572,7 @@ simplify_comparison (code, pop0, pop1)
not on in our mode. */
const_op
=
INTVAL
(
op1
);
if
(
mode_width
<=
HOST_BITS_PER_INT
)
const_op
&=
GET_MODE_MASK
(
mode
)
;
const_op
&=
mask
;
/* If we are comparing against a constant power of two and the value
being compared has only that single significant bit (e.g., it was
...
...
@@ -6590,16 +6590,17 @@ simplify_comparison (code, pop0, pop1)
}
/* Do some canonicalizations based on the comparison code. We prefer
comparisons against zero and then prefer equality comparisons. */
comparisons against zero and then prefer equality comparisons.
If we can reduce the size of a constant, we will do that too. */
switch
(
code
)
{
case
LT
:
/* <
1 is equivalent to <= 0
*/
if
(
const_op
==
1
)
/* <
C is equivalent to <= (C - 1)
*/
if
(
const_op
>
0
)
{
op1
=
const0_rtx
;
const_op
=
0
;
const_op
-=
1
;
op1
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
const_op
)
;
code
=
LE
;
/* ... fall through to LE case below. */
}
...
...
@@ -6607,9 +6608,13 @@ simplify_comparison (code, pop0, pop1)
break
;
case
LE
:
/* <= -1 is equivalent to < 0 */
if
(
op1
==
constm1_rtx
)
op1
=
const0_rtx
,
const_op
=
0
,
code
=
LT
;
/* <= C is equivalent to < (C + 1); we do this for C < 0 */
if
(
const_op
<
0
)
{
const_op
+=
1
;
op1
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
const_op
);
code
=
LT
;
}
/* If we are doing a <= 0 comparison on a value known to have
a zero sign bit, we can replace this with == 0. */
...
...
@@ -6621,11 +6626,11 @@ simplify_comparison (code, pop0, pop1)
break
;
case
GE
:
/* >=
1 is equivalent to > 0
. */
if
(
const_op
==
1
)
/* >=
C is equivalent to > (C - 1)
. */
if
(
const_op
>
0
)
{
op1
=
const0_rtx
;
const_op
=
0
;
const_op
-=
1
;
op1
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
const_op
)
;
code
=
GT
;
/* ... fall through to GT below. */
}
...
...
@@ -6633,9 +6638,13 @@ simplify_comparison (code, pop0, pop1)
break
;
case
GT
:
/* > -1 is equivalent to >= 0. */
if
(
op1
==
constm1_rtx
)
op1
=
const0_rtx
,
const_op
=
0
,
code
=
GE
;
/* > C is equivalent to >= (C + 1); we do this for C < 0*/
if
(
const_op
<
0
)
{
const_op
+=
1
;
op1
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
const_op
);
code
=
GE
;
}
/* If we are doing a > 0 comparison on a value known to have
a zero sign bit, we can replace this with != 0. */
...
...
@@ -6646,16 +6655,16 @@ simplify_comparison (code, pop0, pop1)
code
=
NE
;
break
;
case
GEU
:
/* unsigned >= 1 is equivalent to != 0 */
if
(
const_op
==
1
)
op1
=
const0_rtx
,
const_op
=
0
,
code
=
NE
;
break
;
case
LTU
:
/* unsigned < 1 is equivalent to == 0 */
if
(
const_op
==
1
)
op1
=
const0_rtx
,
const_op
=
0
,
code
=
EQ
;
/* < C is equivalent to <= (C - 1). */
if
(
const_op
>
0
)
{
const_op
-=
1
;
op1
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
const_op
);
code
=
LEU
;
/* ... fall through ... */
}
else
break
;
case
LEU
:
...
...
@@ -6664,6 +6673,18 @@ simplify_comparison (code, pop0, pop1)
code
=
EQ
;
break
;
case
GEU
:
/* >= C is equivalent to < (C - 1). */
if
(
const_op
>
1
)
{
const_op
-=
1
;
op1
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
const_op
);
code
=
GTU
;
/* ... fall through ... */
}
else
break
;
case
GTU
:
/* unsigned > 0 is equivalent to != 0 */
if
(
const_op
==
0
)
...
...
gcc/reload.c
View file @
4803a34a
...
...
@@ -4264,15 +4264,19 @@ refers_to_regno_for_reload_p (regno, endregno, x, loc)
case
REG
:
i
=
REGNO
(
x
);
if
(
i
>=
FIRST_PSEUDO_REGISTER
&&
reg_renumber
[
i
]
==
-
1
&&
((
reg_equiv_address
[
i
]
&&
refers_to_regno_for_reload_p
(
regno
,
endregno
,
reg_equiv_address
[
i
],
0
))
||
(
reg_equiv_mem
[
i
]
&&
refers_to_regno_for_reload_p
(
regno
,
endregno
,
XEXP
(
reg_equiv_mem
[
i
],
0
),
0
))))
return
1
;
/* If this is a pseudo, a hard register must not have been allocated.
X must therefore either be a constant or be in memory. */
if
(
i
>=
FIRST_PSEUDO_REGISTER
)
{
if
(
reg_equiv_memory_loc
[
i
])
return
refers_to_regno_for_reload_p
(
regno
,
endregno
,
reg_equiv_memory_loc
[
i
],
0
);
if
(
reg_equiv_constant
[
i
])
return
0
;
abort
();
}
return
(
endregno
>
i
&&
regno
<
i
+
(
i
<
FIRST_PSEUDO_REGISTER
...
...
@@ -4372,34 +4376,23 @@ reg_overlap_mentioned_for_reload_p (x, in)
else
if
(
GET_CODE
(
x
)
==
REG
)
{
regno
=
REGNO
(
x
);
if
(
regno
>=
FIRST_PSEUDO_REGISTER
&&
reg_renumber
[
regno
]
==
-
1
&&
((
reg_equiv_address
[
regno
]
&&
reg_overlap_mentioned_for_reload_p
(
reg_equiv_address
[
regno
],
in
))
||
(
reg_equiv_mem
[
regno
]
&&
reg_overlap_mentioned_for_reload_p
(
reg_equiv_mem
[
regno
],
in
))))
return
1
;
}
else
if
(
CONSTANT_P
(
x
))
return
0
;
else
if
(
GET_CODE
(
x
)
==
MEM
)
{
char
*
fmt
;
int
i
;
if
(
GET_CODE
(
in
)
==
MEM
)
return
1
;
fmt
=
GET_RTX_FORMAT
(
GET_CODE
(
in
));
for
(
i
=
GET_RTX_LENGTH
(
GET_CODE
(
in
))
-
1
;
i
>=
0
;
i
--
)
if
(
fmt
[
i
]
==
'e'
&&
reg_overlap_mentioned_for_reload_p
(
x
,
XEXP
(
in
,
i
)))
return
1
;
/* If this is a pseudo, it must not have been assigned a hard register.
Therefore, it must either be in memory or be a constant. */
if
(
regno
>=
FIRST_PSEUDO_REGISTER
)
{
if
(
reg_equiv_memory_loc
[
regno
])
return
refers_to_mem_for_reload_p
(
in
);
else
if
(
reg_equiv_constant
[
regno
])
return
0
;
abort
();
}
}
else
if
(
CONSTANT_P
(
x
))
return
0
;
else
if
(
GET_CODE
(
x
)
==
MEM
)
return
refers_to_mem_for_reload_p
(
in
);
else
if
(
GET_CODE
(
x
)
==
SCRATCH
||
GET_CODE
(
x
)
==
PC
||
GET_CODE
(
x
)
==
CC0
)
return
reg_mentioned_p
(
x
,
in
);
...
...
@@ -4412,6 +4405,33 @@ reg_overlap_mentioned_for_reload_p (x, in)
return
refers_to_regno_for_reload_p
(
regno
,
endregno
,
in
,
0
);
}
/* Return nonzero if anything in X contains a MEM. Look also for pseudo
registers. */
int
refers_to_mem_for_reload_p
(
x
)
rtx
x
;
{
char
*
fmt
;
int
i
;
if
(
GET_CODE
(
x
)
==
MEM
)
return
1
;
if
(
GET_CODE
(
x
)
==
REG
)
return
(
REGNO
(
x
)
>=
FIRST_PSEUDO_REGISTER
&&
reg_equiv_memory_loc
[
REGNO
(
x
)]);
fmt
=
GET_RTX_FORMAT
(
GET_CODE
(
x
));
for
(
i
=
GET_RTX_LENGTH
(
GET_CODE
(
x
))
-
1
;
i
>=
0
;
i
--
)
if
(
fmt
[
i
]
==
'e'
&&
(
GET_CODE
(
XEXP
(
x
,
i
))
==
MEM
||
refers_to_mem_for_reload_p
(
XEXP
(
x
,
i
))))
return
1
;
return
0
;
}
#if 0
/* [[This function is currently obsolete, now that volatility
...
...
gcc/reload1.c
View file @
4803a34a
...
...
@@ -89,7 +89,7 @@ rtx *reg_equiv_constant;
prior to any register elimination (such as frame pointer to stack
pointer). Depending on whether or not it is a valid address, this value
is transferred to either reg_equiv_address or reg_equiv_mem. */
static
rtx
*
reg_equiv_memory_loc
;
rtx
*
reg_equiv_memory_loc
;
/* Element N is the address of stack slot to which pseudo reg N is equivalent.
This is used when the address is not valid as a memory address
...
...
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