Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
3537b793
Commit
3537b793
authored
Jan 17, 2011
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arm bug address of a string
R=r CC=golang-dev
https://golang.org/cl/4004042
parent
3965519a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
peep.c
src/cmd/5g/peep.c
+3
-1
reg.c
src/cmd/5g/reg.c
+23
-11
No files found.
src/cmd/5g/peep.c
View file @
3537b793
...
...
@@ -336,6 +336,7 @@ subprop(Reg *r0)
case
ACMN
:
case
AADD
:
case
ASUB
:
case
ASBC
:
case
ARSB
:
case
ASLL
:
case
ASRL
:
...
...
@@ -621,8 +622,8 @@ shiftprop(Reg *r)
case
AADC
:
case
AORR
:
case
ASUB
:
case
ARSB
:
case
ASBC
:
case
ARSB
:
case
ARSC
:
if
(
p1
->
reg
==
n
||
(
p1
->
reg
==
NREG
&&
p1
->
to
.
type
==
D_REG
&&
p1
->
to
.
reg
==
n
))
{
if
(
p1
->
from
.
type
!=
D_REG
)
...
...
@@ -1006,6 +1007,7 @@ copyu(Prog *p, Adr *v, Adr *s)
case
AADD
:
/* read, read, write */
case
ASUB
:
case
ASBC
:
case
ARSB
:
case
ASLL
:
case
ASRL
:
...
...
src/cmd/5g/reg.c
View file @
3537b793
...
...
@@ -253,8 +253,7 @@ regopt(Prog *firstp)
* funny
*/
case
ABL
:
for
(
z
=
0
;
z
<
BITS
;
z
++
)
addrs
.
b
[
z
]
|=
bit
.
b
[
z
];
setaddrs
(
bit
);
break
;
}
...
...
@@ -272,6 +271,18 @@ regopt(Prog *firstp)
if
(
firstr
==
R
)
return
;
for
(
i
=
0
;
i
<
nvar
;
i
++
)
{
Var
*
v
=
var
+
i
;
if
(
v
->
addr
)
{
bit
=
blsh
(
i
);
for
(
z
=
0
;
z
<
BITS
;
z
++
)
addrs
.
b
[
z
]
|=
bit
.
b
[
z
];
}
// print("bit=%2d addr=%d et=%-6E w=%-2d s=%S + %lld\n",
// i, v->addr, v->etype, v->width, v->sym, v->offset);
}
/*
* pass 2
* turn branch references to pointers
...
...
@@ -637,6 +648,10 @@ mkvar(Reg *r, Adr *a, int docon)
t
=
a
->
type
;
n
=
D_NONE
;
flag
=
0
;
// if(a->pun)
// flag = 1;
switch
(
t
)
{
default:
print
(
"type %d %d %D
\n
"
,
t
,
a
->
name
,
a
);
...
...
@@ -647,15 +662,19 @@ mkvar(Reg *r, Adr *a, int docon)
case
D_BRANCH
:
break
;
case
D_CONST
:
flag
=
1
;
goto
onereg
;
case
D_REGREG
:
if
(
a
->
offset
!=
NREG
)
r
->
regu
|=
RtoB
(
a
->
offset
);
// fallthrough
goto
onereg
;
case
D_CONST
:
case
D_REG
:
case
D_SHIFT
:
case
D_OREG
:
onereg:
if
(
a
->
reg
!=
NREG
)
r
->
regu
|=
RtoB
(
a
->
reg
);
break
;
...
...
@@ -678,10 +697,6 @@ mkvar(Reg *r, Adr *a, int docon)
break
;
}
flag
=
0
;
// if(a->pun)
// flag = 1;
s
=
a
->
sym
;
if
(
s
==
S
)
goto
none
;
...
...
@@ -736,7 +751,6 @@ mkvar(Reg *r, Adr *a, int docon)
if
(
debug
[
'R'
])
print
(
"bit=%2d et=%E pun=%d %D
\n
"
,
i
,
et
,
flag
,
a
);
out:
bit
=
blsh
(
i
);
if
(
n
==
D_EXTERN
||
n
==
D_STATIC
)
for
(
z
=
0
;
z
<
BITS
;
z
++
)
...
...
@@ -744,8 +758,6 @@ out:
if
(
n
==
D_PARAM
)
for
(
z
=
0
;
z
<
BITS
;
z
++
)
params
.
b
[
z
]
|=
bit
.
b
[
z
];
if
(
t
==
D_CONST
)
setaddrs
(
bit
);
return
bit
;
...
...
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