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
f51b8572
Commit
f51b8572
authored
Apr 15, 2014
by
Eric Botcazou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc-interface/trans.c (Case_Statement_to_gnu): Revert latest change.
From-SVN: r209415
parent
4b3f9829
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
gcc/ada/ChangeLog
+0
-2
gcc/ada/gcc-interface/trans.c
+17
-12
No files found.
gcc/ada/ChangeLog
View file @
f51b8572
...
@@ -12,8 +12,6 @@
...
@@ -12,8 +12,6 @@
(
lvalue_required_p
)
<
N_Object_Renaming_Declaration
>:
Always
return
1.
(
lvalue_required_p
)
<
N_Object_Renaming_Declaration
>:
Always
return
1.
(
Identifier_to_gnu
):
Reference
the
renamed
object
of
constant
renaming
(
Identifier_to_gnu
):
Reference
the
renamed
object
of
constant
renaming
pointers
directly
.
pointers
directly
.
(
Case_Statement_to_gnu
):
Do
not
re
-
fold
the
bounds
of
integer
types
.
Assert
that
the
case
values
are
constant
.
*
gcc
-
interface
/
utils
.
c
(
invalidate_global_renaming_pointers
):
Do
not
*
gcc
-
interface
/
utils
.
c
(
invalidate_global_renaming_pointers
):
Do
not
invalidate
constant
renaming
pointers
.
invalidate
constant
renaming
pointers
.
...
...
gcc/ada/gcc-interface/trans.c
View file @
f51b8572
...
@@ -2400,11 +2400,9 @@ Case_Statement_to_gnu (Node_Id gnat_node)
...
@@ -2400,11 +2400,9 @@ Case_Statement_to_gnu (Node_Id gnat_node)
/* First compile all the different case choices for the current WHEN
/* First compile all the different case choices for the current WHEN
alternative. */
alternative. */
for
(
gnat_choice
=
First
(
Discrete_Choices
(
gnat_when
));
for
(
gnat_choice
=
First
(
Discrete_Choices
(
gnat_when
));
Present
(
gnat_choice
);
Present
(
gnat_choice
);
gnat_choice
=
Next
(
gnat_choice
))
gnat_choice
=
Next
(
gnat_choice
))
{
{
tree
gnu_low
=
NULL_TREE
,
gnu_high
=
NULL_TREE
;
tree
gnu_low
=
NULL_TREE
,
gnu_high
=
NULL_TREE
;
tree
label
=
create_artificial_label
(
input_location
);
switch
(
Nkind
(
gnat_choice
))
switch
(
Nkind
(
gnat_choice
))
{
{
...
@@ -2428,8 +2426,8 @@ Case_Statement_to_gnu (Node_Id gnat_node)
...
@@ -2428,8 +2426,8 @@ Case_Statement_to_gnu (Node_Id gnat_node)
{
{
tree
gnu_type
=
get_unpadded_type
(
Entity
(
gnat_choice
));
tree
gnu_type
=
get_unpadded_type
(
Entity
(
gnat_choice
));
gnu_low
=
TYPE_MIN_VALUE
(
gnu_type
);
gnu_low
=
fold
(
TYPE_MIN_VALUE
(
gnu_type
)
);
gnu_high
=
TYPE_MAX_VALUE
(
gnu_type
);
gnu_high
=
fold
(
TYPE_MAX_VALUE
(
gnu_type
)
);
break
;
break
;
}
}
...
@@ -2447,13 +2445,20 @@ Case_Statement_to_gnu (Node_Id gnat_node)
...
@@ -2447,13 +2445,20 @@ Case_Statement_to_gnu (Node_Id gnat_node)
gcc_unreachable
();
gcc_unreachable
();
}
}
/* Everything should be folded into constants at this point. */
/* If the case value is a subtype that raises Constraint_Error at
gcc_assert
(
!
gnu_low
||
TREE_CODE
(
gnu_low
)
==
INTEGER_CST
);
run time because of a wrong bound, then gnu_low or gnu_high is
gcc_assert
(
!
gnu_high
||
TREE_CODE
(
gnu_high
)
==
INTEGER_CST
);
not translated into an INTEGER_CST. In such a case, we need
to ensure that the when statement is not added in the tree,
add_stmt_with_node
(
build_case_label
(
gnu_low
,
gnu_high
,
label
),
otherwise it will crash the gimplifier. */
gnat_choice
);
if
((
!
gnu_low
||
TREE_CODE
(
gnu_low
)
==
INTEGER_CST
)
choices_added_p
=
true
;
&&
(
!
gnu_high
||
TREE_CODE
(
gnu_high
)
==
INTEGER_CST
))
{
add_stmt_with_node
(
build_case_label
(
gnu_low
,
gnu_high
,
create_artificial_label
(
input_location
)),
gnat_choice
);
choices_added_p
=
true
;
}
}
}
/* This construct doesn't define a scope so we shouldn't push a binding
/* This construct doesn't define a scope so we shouldn't push a binding
...
...
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