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
1c69865d
Commit
1c69865d
authored
Oct 12, 1994
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allocate attr_value_list with xmalloc rather than alloca
From-SVN: r8261
parent
361f1653
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
gcc/genattrtab.c
+19
-2
No files found.
gcc/genattrtab.c
View file @
1c69865d
...
@@ -310,6 +310,7 @@ static int length_used;
...
@@ -310,6 +310,7 @@ static int length_used;
static
int
num_delays
;
static
int
num_delays
;
static
int
have_annul_true
,
have_annul_false
;
static
int
have_annul_true
,
have_annul_false
;
static
int
num_units
;
static
int
num_units
;
static
int
num_insn_ents
;
/* Used as operand to `operate_exp': */
/* Used as operand to `operate_exp': */
...
@@ -2545,6 +2546,8 @@ remove_insn_ent (av, ie)
...
@@ -2545,6 +2546,8 @@ remove_insn_ent (av, ie)
av
->
num_insns
--
;
av
->
num_insns
--
;
if
(
ie
->
insn_code
==
-
1
)
if
(
ie
->
insn_code
==
-
1
)
av
->
has_asm_insn
=
0
;
av
->
has_asm_insn
=
0
;
num_insn_ents
--
;
}
}
/* Insert an insn entry in an attribute value list. */
/* Insert an insn entry in an attribute value list. */
...
@@ -2559,6 +2562,8 @@ insert_insn_ent (av, ie)
...
@@ -2559,6 +2562,8 @@ insert_insn_ent (av, ie)
av
->
num_insns
++
;
av
->
num_insns
++
;
if
(
ie
->
insn_code
==
-
1
)
if
(
ie
->
insn_code
==
-
1
)
av
->
has_asm_insn
=
1
;
av
->
has_asm_insn
=
1
;
num_insn_ents
++
;
}
}
/* This is a utility routine to take an expression that is a tree of either
/* This is a utility routine to take an expression that is a tree of either
...
@@ -3293,6 +3298,7 @@ optimize_attrs ()
...
@@ -3293,6 +3298,7 @@ optimize_attrs ()
struct
attr_desc
*
attr
;
struct
attr_desc
*
attr
;
struct
attr_value_list
*
next
;
};
struct
attr_value_list
*
next
;
};
struct
attr_value_list
**
insn_code_values
;
struct
attr_value_list
**
insn_code_values
;
struct
attr_value_list
*
ivbuf
;
struct
attr_value_list
*
iv
;
struct
attr_value_list
*
iv
;
/* For each insn code, make a list of all the insn_ent's for it,
/* For each insn code, make a list of all the insn_ent's for it,
...
@@ -3308,20 +3314,29 @@ optimize_attrs ()
...
@@ -3308,20 +3314,29 @@ optimize_attrs ()
/* Offset the table address so we can index by -2 or -1. */
/* Offset the table address so we can index by -2 or -1. */
insn_code_values
+=
2
;
insn_code_values
+=
2
;
/* Allocate the attr_value_list structures using xmalloc rather than
alloca, because using alloca can overflow the maximum permitted
stack limit on SPARC Lynx. */
iv
=
ivbuf
=
((
struct
attr_value_list
*
)
xmalloc
(
num_insn_ents
*
sizeof
(
struct
attr_value_list
)));
for
(
i
=
0
;
i
<
MAX_ATTRS_INDEX
;
i
++
)
for
(
i
=
0
;
i
<
MAX_ATTRS_INDEX
;
i
++
)
for
(
attr
=
attrs
[
i
];
attr
;
attr
=
attr
->
next
)
for
(
attr
=
attrs
[
i
];
attr
;
attr
=
attr
->
next
)
for
(
av
=
attr
->
first_value
;
av
;
av
=
av
->
next
)
for
(
av
=
attr
->
first_value
;
av
;
av
=
av
->
next
)
for
(
ie
=
av
->
first_insn
;
ie
;
ie
=
ie
->
next
)
for
(
ie
=
av
->
first_insn
;
ie
;
ie
=
ie
->
next
)
{
{
iv
=
((
struct
attr_value_list
*
)
alloca
(
sizeof
(
struct
attr_value_list
)));
iv
->
attr
=
attr
;
iv
->
attr
=
attr
;
iv
->
av
=
av
;
iv
->
av
=
av
;
iv
->
ie
=
ie
;
iv
->
ie
=
ie
;
iv
->
next
=
insn_code_values
[
ie
->
insn_code
];
iv
->
next
=
insn_code_values
[
ie
->
insn_code
];
insn_code_values
[
ie
->
insn_code
]
=
iv
;
insn_code_values
[
ie
->
insn_code
]
=
iv
;
iv
++
;
}
}
/* Sanity check on num_insn_ents. */
if
(
iv
!=
ivbuf
+
num_insn_ents
)
abort
();
/* Process one insn code at a time. */
/* Process one insn code at a time. */
for
(
i
=
-
2
;
i
<
insn_code_number
;
i
++
)
for
(
i
=
-
2
;
i
<
insn_code_number
;
i
++
)
{
{
...
@@ -3371,6 +3386,8 @@ optimize_attrs ()
...
@@ -3371,6 +3386,8 @@ optimize_attrs ()
}
}
}
}
}
}
free
(
ivbuf
);
}
}
#if 0
#if 0
...
...
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