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
d14774f0
Commit
d14774f0
authored
Nov 10, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(process_init_constructor): Strip NOP_EXPR from indices.
Clear end_index if there's an error in a range. From-SVN: r2730
parent
385a69e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
gcc/c-typeck.c
+15
-5
No files found.
gcc/c-typeck.c
View file @
d14774f0
...
@@ -4970,7 +4970,8 @@ process_init_constructor (type, init, elts, constant_value, constant_element,
...
@@ -4970,7 +4970,8 @@ process_init_constructor (type, init, elts, constant_value, constant_element,
int
win
=
0
;
int
win
=
0
;
tree
index
=
TREE_PURPOSE
(
tail
);
tree
index
=
TREE_PURPOSE
(
tail
);
if
(
index
&&
TREE_CODE
(
index
)
==
NON_LVALUE_EXPR
)
if
(
index
&&
(
TREE_CODE
(
index
)
==
NON_LVALUE_EXPR
||
TREE_CODE
(
index
)
==
NOP_EXPR
))
index
=
TREE_OPERAND
(
index
,
0
);
index
=
TREE_OPERAND
(
index
,
0
);
/* Begin a range. */
/* Begin a range. */
...
@@ -4979,10 +4980,15 @@ process_init_constructor (type, init, elts, constant_value, constant_element,
...
@@ -4979,10 +4980,15 @@ process_init_constructor (type, init, elts, constant_value, constant_element,
start_index
=
TREE_PURPOSE
(
index
);
start_index
=
TREE_PURPOSE
(
index
);
end_index
=
TREE_PURPOSE
(
TREE_CHAIN
(
index
));
end_index
=
TREE_PURPOSE
(
TREE_CHAIN
(
index
));
/* Expose constants. */
/* Expose constants. It Doesn't matter if we change
if
(
end_index
&&
TREE_CODE
(
end_index
)
==
NON_LVALUE_EXPR
)
the mode.*/
if
(
end_index
&&
(
TREE_CODE
(
end_index
)
==
NON_LVALUE_EXPR
||
TREE_CODE
(
end_index
)
==
NOP_EXPR
))
end_index
=
TREE_OPERAND
(
end_index
,
0
);
end_index
=
TREE_OPERAND
(
end_index
,
0
);
if
(
start_index
&&
TREE_CODE
(
start_index
)
==
NON_LVALUE_EXPR
)
if
(
start_index
&&
(
TREE_CODE
(
start_index
)
==
NON_LVALUE_EXPR
||
TREE_CODE
(
start_index
)
==
NOP_EXPR
))
start_index
=
TREE_OPERAND
(
start_index
,
0
);
start_index
=
TREE_OPERAND
(
start_index
,
0
);
if
((
TREE_CODE
(
start_index
)
==
IDENTIFIER_NODE
)
if
((
TREE_CODE
(
start_index
)
==
IDENTIFIER_NODE
)
...
@@ -5026,7 +5032,11 @@ process_init_constructor (type, init, elts, constant_value, constant_element,
...
@@ -5026,7 +5032,11 @@ process_init_constructor (type, init, elts, constant_value, constant_element,
current_index
=
index
,
win
=
1
;
current_index
=
index
,
win
=
1
;
if
(
!
win
)
if
(
!
win
)
TREE_VALUE
(
tail
)
=
error_mark_node
;
{
/* If there was an error, end the current range. */
end_index
=
0
;
TREE_VALUE
(
tail
)
=
error_mark_node
;
}
}
}
if
(
max_index
&&
tree_int_cst_lt
(
max_index
,
current_index
))
if
(
max_index
&&
tree_int_cst_lt
(
max_index
,
current_index
))
...
...
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