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
4381f7c2
Commit
4381f7c2
authored
Aug 29, 2000
by
Kazu Hirata
Committed by
Jeff Law
Aug 29, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reload.c: Fix formatting.
* reload.c: Fix formatting. * stmt.c: Fix formatting. From-SVN: r36051
parent
9218435e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
61 deletions
+58
-61
gcc/ChangeLog
+4
-0
gcc/reload.c
+12
-18
gcc/stmt.c
+42
-43
No files found.
gcc/ChangeLog
View file @
4381f7c2
2000-08-29 Kazu Hirata <kazu@hxi.com>
2000-08-29 Kazu Hirata <kazu@hxi.com>
* reload.c: Fix formatting.
* stmt.c: Fix formatting.
* gcc.c: Fix formatting.
* gcc.c: Fix formatting.
2000-08-29 Zack Weinberg <zack@wolery.cumb.org>
2000-08-29 Zack Weinberg <zack@wolery.cumb.org>
...
...
gcc/reload.c
View file @
4381f7c2
...
@@ -19,7 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
...
@@ -19,7 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
Boston, MA 02111-1307, USA. */
/* This file contains subroutines used only from the file reload1.c.
/* This file contains subroutines used only from the file reload1.c.
It knows how to scan one insn for operands and values
It knows how to scan one insn for operands and values
that need to be copied into registers to make valid code.
that need to be copied into registers to make valid code.
...
@@ -71,7 +70,6 @@ NOTE SIDE EFFECTS:
...
@@ -71,7 +70,6 @@ NOTE SIDE EFFECTS:
2 happens only when REPLACE is 1, which is only when
2 happens only when REPLACE is 1, which is only when
actually doing the reloads, not when just counting them.
actually doing the reloads, not when just counting them.
Using a reload register for several reloads in one insn:
Using a reload register for several reloads in one insn:
When an insn has reloads, it is considered as having three parts:
When an insn has reloads, it is considered as having three parts:
...
@@ -2173,7 +2171,7 @@ decompose (x)
...
@@ -2173,7 +2171,7 @@ decompose (x)
||
GET_CODE
(
addr
)
==
POST_DEC
||
GET_CODE
(
addr
)
==
POST_INC
)
||
GET_CODE
(
addr
)
==
POST_DEC
||
GET_CODE
(
addr
)
==
POST_INC
)
{
{
val
.
base
=
XEXP
(
addr
,
0
);
val
.
base
=
XEXP
(
addr
,
0
);
val
.
start
=
-
GET_MODE_SIZE
(
GET_MODE
(
x
));
val
.
start
=
-
GET_MODE_SIZE
(
GET_MODE
(
x
));
val
.
end
=
GET_MODE_SIZE
(
GET_MODE
(
x
));
val
.
end
=
GET_MODE_SIZE
(
GET_MODE
(
x
));
val
.
safe
=
REGNO
(
val
.
base
)
==
STACK_POINTER_REGNUM
;
val
.
safe
=
REGNO
(
val
.
base
)
==
STACK_POINTER_REGNUM
;
return
val
;
return
val
;
...
@@ -2333,7 +2331,6 @@ immune_p (x, y, ydata)
...
@@ -2333,7 +2331,6 @@ immune_p (x, y, ydata)
return
0
;
return
0
;
}
}
return
(
xdata
.
start
>=
ydata
.
end
||
ydata
.
start
>=
xdata
.
end
);
return
(
xdata
.
start
>=
ydata
.
end
||
ydata
.
start
>=
xdata
.
end
);
}
}
...
@@ -2878,7 +2875,8 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -2878,7 +2875,8 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
case
'#'
:
case
'#'
:
/* Ignore rest of this alternative as far as
/* Ignore rest of this alternative as far as
reloading is concerned. */
reloading is concerned. */
while
(
*
p
&&
*
p
!=
','
)
p
++
;
while
(
*
p
&&
*
p
!=
','
)
p
++
;
break
;
break
;
case
'0'
:
case
'1'
:
case
'2'
:
case
'3'
:
case
'4'
:
case
'0'
:
case
'1'
:
case
'2'
:
case
'3'
:
case
'4'
:
...
@@ -2902,9 +2900,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -2902,9 +2900,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
only on one side of its diagonal. */
only on one side of its diagonal. */
?
(
operands_match
?
(
operands_match
[(
c
==
commutative
||
c
==
commutative
+
1
)
[(
c
==
commutative
||
c
==
commutative
+
1
)
?
2
*
commutative
+
1
-
c
:
c
]
?
2
*
commutative
+
1
-
c
:
c
]
[(
i
==
commutative
||
i
==
commutative
+
1
)
[(
i
==
commutative
||
i
==
commutative
+
1
)
?
2
*
commutative
+
1
-
i
:
i
])
?
2
*
commutative
+
1
-
i
:
i
])
:
operands_match
[
c
][
i
])
:
operands_match
[
c
][
i
])
{
{
/* If we are matching a non-offsettable address where an
/* If we are matching a non-offsettable address where an
...
@@ -3233,7 +3231,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3233,7 +3231,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
&&
!
const_to_mem
)
&&
!
const_to_mem
)
bad
=
1
;
bad
=
1
;
/* We prefer to reload pseudos over reloading other things,
/* We prefer to reload pseudos over reloading other things,
since such reloads may be able to be eliminated later.
since such reloads may be able to be eliminated later.
If we are reloading a SCRATCH, we won't be generating any
If we are reloading a SCRATCH, we won't be generating any
...
@@ -3276,7 +3273,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3276,7 +3273,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
Don't do this if the preferred class has only one register
Don't do this if the preferred class has only one register
because we might otherwise exhaust the class. */
because we might otherwise exhaust the class. */
if
(
!
win
&&
this_alternative
[
i
]
!=
(
int
)
NO_REGS
if
(
!
win
&&
this_alternative
[
i
]
!=
(
int
)
NO_REGS
&&
GET_MODE_SIZE
(
operand_mode
[
i
])
<=
UNITS_PER_WORD
&&
GET_MODE_SIZE
(
operand_mode
[
i
])
<=
UNITS_PER_WORD
&&
reg_class_size
[(
int
)
preferred_class
[
i
]]
>
1
)
&&
reg_class_size
[(
int
)
preferred_class
[
i
]]
>
1
)
...
@@ -3511,7 +3507,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3511,7 +3507,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
tem
=
*
recog_data
.
operand_loc
[
commutative
];
tem
=
*
recog_data
.
operand_loc
[
commutative
];
*
recog_data
.
operand_loc
[
commutative
]
*
recog_data
.
operand_loc
[
commutative
]
=
*
recog_data
.
operand_loc
[
commutative
+
1
];
=
*
recog_data
.
operand_loc
[
commutative
+
1
];
*
recog_data
.
operand_loc
[
commutative
+
1
]
=
tem
;
*
recog_data
.
operand_loc
[
commutative
+
1
]
=
tem
;
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
{
{
...
@@ -3947,8 +3943,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3947,8 +3943,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
{
{
int
secondary_in_reload
=
rld
[
i
].
secondary_in_reload
;
int
secondary_in_reload
=
rld
[
i
].
secondary_in_reload
;
rld
[
secondary_in_reload
].
when_needed
rld
[
secondary_in_reload
].
when_needed
=
RELOAD_FOR_OPADDR_ADDR
;
=
RELOAD_FOR_OPADDR_ADDR
;
/* If there's a tertiary reload we have to change it also. */
/* If there's a tertiary reload we have to change it also. */
if
(
secondary_in_reload
>
0
if
(
secondary_in_reload
>
0
...
@@ -3963,8 +3958,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3963,8 +3958,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
{
{
int
secondary_out_reload
=
rld
[
i
].
secondary_out_reload
;
int
secondary_out_reload
=
rld
[
i
].
secondary_out_reload
;
rld
[
secondary_out_reload
].
when_needed
rld
[
secondary_out_reload
].
when_needed
=
RELOAD_FOR_OPADDR_ADDR
;
=
RELOAD_FOR_OPADDR_ADDR
;
/* If there's a tertiary reload we have to change it also. */
/* If there's a tertiary reload we have to change it also. */
if
(
secondary_out_reload
if
(
secondary_out_reload
...
@@ -4018,7 +4012,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -4018,7 +4012,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
int
first_op_addr_num
=
-
2
;
int
first_op_addr_num
=
-
2
;
int
first_inpaddr_num
[
MAX_RECOG_OPERANDS
];
int
first_inpaddr_num
[
MAX_RECOG_OPERANDS
];
int
first_outpaddr_num
[
MAX_RECOG_OPERANDS
];
int
first_outpaddr_num
[
MAX_RECOG_OPERANDS
];
int
need_change
=
0
;
int
need_change
=
0
;
/* We use last_op_addr_reload and the contents of the above arrays
/* We use last_op_addr_reload and the contents of the above arrays
first as flags - -2 means no instance encountered, -1 means exactly
first as flags - -2 means no instance encountered, -1 means exactly
one instance encountered.
one instance encountered.
...
@@ -5131,7 +5125,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
...
@@ -5131,7 +5125,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
of another register or by a constant value. Thus, these
of another register or by a constant value. Thus, these
operands must match. */
operands must match. */
if
(
op0
!=
XEXP
(
op1
,
0
))
if
(
op0
!=
XEXP
(
op1
,
0
))
abort
();
abort
();
/* Require index register (or constant). Let's just handle the
/* Require index register (or constant). Let's just handle the
register case in the meantime... If the target allows
register case in the meantime... If the target allows
...
@@ -5193,7 +5187,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
...
@@ -5193,7 +5187,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
}
}
}
}
else
else
abort
();
abort
();
}
}
return
0
;
return
0
;
...
@@ -5928,7 +5922,7 @@ refers_to_regno_for_reload_p (regno, endregno, x, loc)
...
@@ -5928,7 +5922,7 @@ refers_to_regno_for_reload_p (regno, endregno, x, loc)
else
if
(
fmt
[
i
]
==
'E'
)
else
if
(
fmt
[
i
]
==
'E'
)
{
{
register
int
j
;
register
int
j
;
for
(
j
=
XVECLEN
(
x
,
i
)
-
1
;
j
>=
0
;
j
--
)
for
(
j
=
XVECLEN
(
x
,
i
)
-
1
;
j
>=
0
;
j
--
)
if
(
loc
!=
&
XVECEXP
(
x
,
i
,
j
)
if
(
loc
!=
&
XVECEXP
(
x
,
i
,
j
)
&&
refers_to_regno_for_reload_p
(
regno
,
endregno
,
&&
refers_to_regno_for_reload_p
(
regno
,
endregno
,
XVECEXP
(
x
,
i
,
j
),
loc
))
XVECEXP
(
x
,
i
,
j
),
loc
))
...
...
gcc/stmt.c
View file @
4381f7c2
...
@@ -19,7 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
...
@@ -19,7 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
Boston, MA 02111-1307, USA. */
/* This file handles the generation of rtl code from tree structure
/* This file handles the generation of rtl code from tree structure
above the level of expressions, using subroutines in exp*.c and emit-rtl.c.
above the level of expressions, using subroutines in exp*.c and emit-rtl.c.
It also creates the rtl expressions for parameters and auto variables
It also creates the rtl expressions for parameters and auto variables
...
@@ -65,7 +64,6 @@ struct obstack stmt_obstack;
...
@@ -65,7 +64,6 @@ struct obstack stmt_obstack;
#define CASE_VECTOR_PC_RELATIVE 0
#define CASE_VECTOR_PC_RELATIVE 0
#endif
#endif
/* Functions and data structures for expanding case statements. */
/* Functions and data structures for expanding case statements. */
/* Case label structure, used to hold info on labels within case
/* Case label structure, used to hold info on labels within case
...
@@ -400,7 +398,6 @@ static int using_eh_for_cleanups_p = 0;
...
@@ -400,7 +398,6 @@ static int using_eh_for_cleanups_p = 0;
/* Character strings, each containing a single decimal digit. */
/* Character strings, each containing a single decimal digit. */
static
char
*
digit_strings
[
10
];
static
char
*
digit_strings
[
10
];
static
int
n_occurrences
PARAMS
((
int
,
const
char
*
));
static
int
n_occurrences
PARAMS
((
int
,
const
char
*
));
static
void
expand_goto_internal
PARAMS
((
tree
,
rtx
,
rtx
));
static
void
expand_goto_internal
PARAMS
((
tree
,
rtx
,
rtx
));
static
int
expand_fixup
PARAMS
((
tree
,
rtx
,
rtx
));
static
int
expand_fixup
PARAMS
((
tree
,
rtx
,
rtx
));
...
@@ -1084,8 +1081,6 @@ expand_fixup (tree_label, rtl_label, last_insn)
...
@@ -1084,8 +1081,6 @@ expand_fixup (tree_label, rtl_label, last_insn)
return
block
!=
0
;
return
block
!=
0
;
}
}
/* Expand any needed fixups in the outputmost binding level of the
/* Expand any needed fixups in the outputmost binding level of the
function. FIRST_INSN is the first insn in the function. */
function. FIRST_INSN is the first insn in the function. */
...
@@ -1215,7 +1210,6 @@ fixup_gotos (thisblock, stack_level, cleanup_list, first_insn, dont_jump_in)
...
@@ -1215,7 +1210,6 @@ fixup_gotos (thisblock, stack_level, cleanup_list, first_insn, dont_jump_in)
end_sequence
();
end_sequence
();
emit_insns_after
(
cleanup_insns
,
f
->
before_jump
);
emit_insns_after
(
cleanup_insns
,
f
->
before_jump
);
f
->
before_jump
=
0
;
f
->
before_jump
=
0
;
}
}
}
}
...
@@ -1695,7 +1689,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
...
@@ -1695,7 +1689,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
break
;
break
;
}
}
/*
... fall through ...
*/
/*
Fall through.
*/
case
'p'
:
case
'r'
:
case
'p'
:
case
'r'
:
allows_reg
=
1
;
allows_reg
=
1
;
...
@@ -2036,7 +2030,7 @@ warn_if_unused_value (exp)
...
@@ -2036,7 +2030,7 @@ warn_if_unused_value (exp)
the user cannot control it. */
the user cannot control it. */
if
(
TREE_CODE
(
TREE_TYPE
(
TREE_OPERAND
(
exp
,
0
)))
==
REFERENCE_TYPE
)
if
(
TREE_CODE
(
TREE_TYPE
(
TREE_OPERAND
(
exp
,
0
)))
==
REFERENCE_TYPE
)
return
warn_if_unused_value
(
TREE_OPERAND
(
exp
,
0
));
return
warn_if_unused_value
(
TREE_OPERAND
(
exp
,
0
));
/*
... fall through ..
. */
/*
Fall through
. */
default
:
default
:
/* Referencing a volatile value is a side effect, so don't warn. */
/* Referencing a volatile value is a side effect, so don't warn. */
...
@@ -2229,8 +2223,6 @@ expand_end_cond ()
...
@@ -2229,8 +2223,6 @@ expand_end_cond ()
last_expr_type
=
0
;
last_expr_type
=
0
;
}
}
/* Generate RTL for the start of a loop. EXIT_FLAG is nonzero if this
/* Generate RTL for the start of a loop. EXIT_FLAG is nonzero if this
loop should be exited by `exit_something'. This is a loop for which
loop should be exited by `exit_something'. This is a loop for which
`expand_continue' will jump to the top of the loop.
`expand_continue' will jump to the top of the loop.
...
@@ -2342,7 +2334,7 @@ expand_end_loop ()
...
@@ -2342,7 +2334,7 @@ expand_end_loop ()
insn
=
PREV_INSN
(
label
);
insn
=
PREV_INSN
(
label
);
reorder_insns
(
label
,
label
,
start_label
);
reorder_insns
(
label
,
label
,
start_label
);
for
(
prev
=
PREV_INSN
(
jump
);
;
prev
=
PREV_INSN
(
prev
))
for
(
prev
=
PREV_INSN
(
jump
);;
prev
=
PREV_INSN
(
prev
))
{
{
/* We ignore line number notes, but if we see any other note,
/* We ignore line number notes, but if we see any other note,
in particular NOTE_INSN_BLOCK_*, NOTE_INSN_EH_REGION_*,
in particular NOTE_INSN_BLOCK_*, NOTE_INSN_EH_REGION_*,
...
@@ -2659,7 +2651,6 @@ expand_exit_loop_if_false (whichloop, cond)
...
@@ -2659,7 +2651,6 @@ expand_exit_loop_if_false (whichloop, cond)
around a unconditional branch to exit the loop. If fixups are
around a unconditional branch to exit the loop. If fixups are
necessary, they go before the unconditional branch. */
necessary, they go before the unconditional branch. */
do_jump
(
cond
,
NULL_RTX
,
label
);
do_jump
(
cond
,
NULL_RTX
,
label
);
last_insn
=
get_last_insn
();
last_insn
=
get_last_insn
();
if
(
GET_CODE
(
last_insn
)
==
CODE_LABEL
)
if
(
GET_CODE
(
last_insn
)
==
CODE_LABEL
)
...
@@ -3150,7 +3141,10 @@ tail_recursion_args (actuals, formals)
...
@@ -3150,7 +3141,10 @@ tail_recursion_args (actuals, formals)
register
int
j
;
register
int
j
;
for
(
f
=
formals
,
j
=
0
;
j
<
i
;
f
=
TREE_CHAIN
(
f
),
j
++
)
for
(
f
=
formals
,
j
=
0
;
j
<
i
;
f
=
TREE_CHAIN
(
f
),
j
++
)
if
(
reg_mentioned_p
(
DECL_RTL
(
f
),
argvec
[
i
]))
if
(
reg_mentioned_p
(
DECL_RTL
(
f
),
argvec
[
i
]))
{
copy
=
1
;
break
;
}
{
copy
=
1
;
break
;
}
if
(
copy
)
if
(
copy
)
argvec
[
i
]
=
copy_to_reg
(
argvec
[
i
]);
argvec
[
i
]
=
copy_to_reg
(
argvec
[
i
]);
}
}
...
@@ -4430,7 +4424,6 @@ expand_start_case (exit_flag, expr, type, printname)
...
@@ -4430,7 +4424,6 @@ expand_start_case (exit_flag, expr, type, printname)
start_cleanup_deferral
();
start_cleanup_deferral
();
}
}
/* Start a "dummy case statement" within which case labels are invalid
/* Start a "dummy case statement" within which case labels are invalid
and are not connected to any larger real case statement.
and are not connected to any larger real case statement.
This can be used if you don't want to let a case statement jump
This can be used if you don't want to let a case statement jump
...
@@ -4504,8 +4497,8 @@ check_seenlabel ()
...
@@ -4504,8 +4497,8 @@ check_seenlabel ()
/* If insn is zero, then there must have been a syntax error. */
/* If insn is zero, then there must have been a syntax error. */
if
(
insn
)
if
(
insn
)
warning_with_file_and_line
(
NOTE_SOURCE_FILE
(
insn
),
warning_with_file_and_line
(
NOTE_SOURCE_FILE
(
insn
),
NOTE_LINE_NUMBER
(
insn
),
NOTE_LINE_NUMBER
(
insn
),
"unreachable code at beginning of %s"
,
"unreachable code at beginning of %s"
,
case_stack
->
data
.
case_stmt
.
printname
);
case_stack
->
data
.
case_stmt
.
printname
);
break
;
break
;
...
@@ -4883,7 +4876,6 @@ add_case_node (low, high, label, duplicate)
...
@@ -4883,7 +4876,6 @@ add_case_node (low, high, label, duplicate)
return
0
;
return
0
;
}
}
/* Returns the number of possible values of TYPE.
/* Returns the number of possible values of TYPE.
Returns -1 if the number is unknown, variable, or if the number does not
Returns -1 if the number is unknown, variable, or if the number does not
fit in a HOST_WIDE_INT.
fit in a HOST_WIDE_INT.
...
@@ -4981,7 +4973,8 @@ mark_seen_cases (type, cases_seen, count, sparseness)
...
@@ -4981,7 +4973,8 @@ mark_seen_cases (type, cases_seen, count, sparseness)
TREE_TYPE
(
val
)
=
type
;
TREE_TYPE
(
val
)
=
type
;
if
(
!
root
)
if
(
!
root
)
;
/* Do nothing */
/* Do nothing. */
;
else
if
(
sparseness
==
2
)
else
if
(
sparseness
==
2
)
{
{
tree
t
;
tree
t
;
...
@@ -5026,7 +5019,7 @@ mark_seen_cases (type, cases_seen, count, sparseness)
...
@@ -5026,7 +5019,7 @@ mark_seen_cases (type, cases_seen, count, sparseness)
{
{
TREE_INT_CST_LOW
(
val
)
=
TREE_INT_CST_LOW
(
n
->
low
);
TREE_INT_CST_LOW
(
val
)
=
TREE_INT_CST_LOW
(
n
->
low
);
TREE_INT_CST_HIGH
(
val
)
=
TREE_INT_CST_HIGH
(
n
->
low
);
TREE_INT_CST_HIGH
(
val
)
=
TREE_INT_CST_HIGH
(
n
->
low
);
while
(
!
tree_int_cst_lt
(
n
->
high
,
val
))
while
(
!
tree_int_cst_lt
(
n
->
high
,
val
))
{
{
/* Calculate (into xlo) the "offset" of the integer (val).
/* Calculate (into xlo) the "offset" of the integer (val).
The element with lowest value has offset 0, the next smallest
The element with lowest value has offset 0, the next smallest
...
@@ -5147,7 +5140,7 @@ check_for_full_enumeration_handling (type)
...
@@ -5147,7 +5140,7 @@ check_for_full_enumeration_handling (type)
mark_seen_cases
(
type
,
cases_seen
,
size
,
sparseness
);
mark_seen_cases
(
type
,
cases_seen
,
size
,
sparseness
);
for
(
i
=
0
;
v
!=
NULL_TREE
&&
i
<
size
;
i
++
,
v
=
TREE_CHAIN
(
v
))
for
(
i
=
0
;
v
!=
NULL_TREE
&&
i
<
size
;
i
++
,
v
=
TREE_CHAIN
(
v
))
if
(
BITARRAY_TEST
(
cases_seen
,
i
)
==
0
)
if
(
BITARRAY_TEST
(
cases_seen
,
i
)
==
0
)
warning
(
"enumeration value `%s' not handled in switch"
,
warning
(
"enumeration value `%s' not handled in switch"
,
IDENTIFIER_POINTER
(
TREE_PURPOSE
(
v
)));
IDENTIFIER_POINTER
(
TREE_PURPOSE
(
v
)));
...
@@ -5300,7 +5293,7 @@ expand_end_case (orig_index)
...
@@ -5300,7 +5293,7 @@ expand_end_case (orig_index)
if
(
thiscase
->
data
.
case_stmt
.
case_list
if
(
thiscase
->
data
.
case_stmt
.
case_list
&&
thiscase
->
data
.
case_stmt
.
case_list
->
left
)
&&
thiscase
->
data
.
case_stmt
.
case_list
->
left
)
thiscase
->
data
.
case_stmt
.
case_list
thiscase
->
data
.
case_stmt
.
case_list
=
case_tree2list
(
thiscase
->
data
.
case_stmt
.
case_list
,
0
);
=
case_tree2list
(
thiscase
->
data
.
case_stmt
.
case_list
,
0
);
/* Simplify the case-list before we count it. */
/* Simplify the case-list before we count it. */
group_case_nodes
(
thiscase
->
data
.
case_stmt
.
case_list
);
group_case_nodes
(
thiscase
->
data
.
case_stmt
.
case_list
);
...
@@ -5396,7 +5389,7 @@ expand_end_case (orig_index)
...
@@ -5396,7 +5389,7 @@ expand_end_case (orig_index)
generate the conversion. */
generate the conversion. */
if
(
GET_MODE_CLASS
(
GET_MODE
(
index
))
==
MODE_INT
if
(
GET_MODE_CLASS
(
GET_MODE
(
index
))
==
MODE_INT
&&
(
cmp_optab
->
handlers
[(
int
)
GET_MODE
(
index
)].
insn_code
&&
(
cmp_optab
->
handlers
[(
int
)
GET_MODE
(
index
)].
insn_code
==
CODE_FOR_nothing
))
==
CODE_FOR_nothing
))
{
{
enum
machine_mode
wider_mode
;
enum
machine_mode
wider_mode
;
...
@@ -5513,22 +5506,22 @@ expand_end_case (orig_index)
...
@@ -5513,22 +5506,22 @@ expand_end_case (orig_index)
index
=
protect_from_queue
(
index
,
0
);
index
=
protect_from_queue
(
index
,
0
);
do_pending_stack_adjust
();
do_pending_stack_adjust
();
op_mode
=
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
0
].
mode
;
op_mode
=
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
0
].
mode
;
if
(
!
(
*
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
0
].
predicate
)
if
(
!
(
*
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
0
].
predicate
)
(
index
,
op_mode
))
(
index
,
op_mode
))
index
=
copy_to_mode_reg
(
op_mode
,
index
);
index
=
copy_to_mode_reg
(
op_mode
,
index
);
op1
=
expand_expr
(
minval
,
NULL_RTX
,
VOIDmode
,
0
);
op1
=
expand_expr
(
minval
,
NULL_RTX
,
VOIDmode
,
0
);
op_mode
=
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
1
].
mode
;
op_mode
=
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
1
].
mode
;
if
(
!
(
*
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
1
].
predicate
)
if
(
!
(
*
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
1
].
predicate
)
(
op1
,
op_mode
))
(
op1
,
op_mode
))
op1
=
copy_to_mode_reg
(
op_mode
,
op1
);
op1
=
copy_to_mode_reg
(
op_mode
,
op1
);
op2
=
expand_expr
(
range
,
NULL_RTX
,
VOIDmode
,
0
);
op2
=
expand_expr
(
range
,
NULL_RTX
,
VOIDmode
,
0
);
op_mode
=
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
2
].
mode
;
op_mode
=
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
2
].
mode
;
if
(
!
(
*
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
2
].
predicate
)
if
(
!
(
*
insn_data
[(
int
)
CODE_FOR_casesi
].
operand
[
2
].
predicate
)
(
op2
,
op_mode
))
(
op2
,
op_mode
))
op2
=
copy_to_mode_reg
(
op_mode
,
op2
);
op2
=
copy_to_mode_reg
(
op_mode
,
op2
);
...
@@ -6097,7 +6090,8 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6097,7 +6090,8 @@ emit_case_nodes (index, node, default_label, index_type)
if
(
node_is_bounded
(
node
->
right
,
index_type
))
if
(
node_is_bounded
(
node
->
right
,
index_type
))
{
{
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
VOIDmode
,
0
),
VOIDmode
,
0
),
GT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
GT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
label_rtx
(
node
->
right
->
code_label
));
label_rtx
(
node
->
right
->
code_label
));
...
@@ -6106,7 +6100,8 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6106,7 +6100,8 @@ emit_case_nodes (index, node, default_label, index_type)
else
if
(
node_is_bounded
(
node
->
left
,
index_type
))
else
if
(
node_is_bounded
(
node
->
left
,
index_type
))
{
{
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
VOIDmode
,
0
),
VOIDmode
,
0
),
LT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
LT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
label_rtx
(
node
->
left
->
code_label
));
label_rtx
(
node
->
left
->
code_label
));
...
@@ -6118,11 +6113,11 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6118,11 +6113,11 @@ emit_case_nodes (index, node, default_label, index_type)
/* Neither node is bounded. First distinguish the two sides;
/* Neither node is bounded. First distinguish the two sides;
then emit the code for one side at a time. */
then emit the code for one side at a time. */
tree
test_label
tree
test_label
=
build_decl
(
LABEL_DECL
,
NULL_TREE
,
NULL_TREE
);
=
build_decl
(
LABEL_DECL
,
NULL_TREE
,
NULL_TREE
);
/* See if the value is on the right. */
/* See if the value is on the right. */
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
VOIDmode
,
0
),
VOIDmode
,
0
),
GT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
GT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
label_rtx
(
test_label
));
label_rtx
(
test_label
));
...
@@ -6153,8 +6148,8 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6153,8 +6148,8 @@ emit_case_nodes (index, node, default_label, index_type)
{
{
if
(
!
node_has_low_bound
(
node
,
index_type
))
if
(
!
node_has_low_bound
(
node
,
index_type
))
{
{
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
emit_cmp_and_jump_insns
(
index
,
NULL_RTX
,
expand_expr
(
node
->
high
,
NULL_RTX
,
VOIDmode
,
0
),
VOIDmode
,
0
),
LT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
LT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
default_label
);
default_label
);
...
@@ -6228,7 +6223,6 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6228,7 +6223,6 @@ emit_case_nodes (index, node, default_label, index_type)
then handle the two subtrees. */
then handle the two subtrees. */
tree
test_label
=
0
;
tree
test_label
=
0
;
if
(
node_is_bounded
(
node
->
right
,
index_type
))
if
(
node_is_bounded
(
node
->
right
,
index_type
))
/* Right hand node is fully bounded so we can eliminate any
/* Right hand node is fully bounded so we can eliminate any
testing and branch directly to the target code. */
testing and branch directly to the target code. */
...
@@ -6242,7 +6236,8 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6242,7 +6236,8 @@ emit_case_nodes (index, node, default_label, index_type)
Branch to a label where we will handle it later. */
Branch to a label where we will handle it later. */
test_label
=
build_decl
(
LABEL_DECL
,
NULL_TREE
,
NULL_TREE
);
test_label
=
build_decl
(
LABEL_DECL
,
NULL_TREE
,
NULL_TREE
);
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
VOIDmode
,
0
),
VOIDmode
,
0
),
GT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
GT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
label_rtx
(
test_label
));
label_rtx
(
test_label
));
...
@@ -6277,7 +6272,8 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6277,7 +6272,8 @@ emit_case_nodes (index, node, default_label, index_type)
if they are possible. */
if they are possible. */
if
(
!
node_has_low_bound
(
node
,
index_type
))
if
(
!
node_has_low_bound
(
node
,
index_type
))
{
{
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
low
,
NULL_RTX
,
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
low
,
NULL_RTX
,
VOIDmode
,
0
),
VOIDmode
,
0
),
LT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
LT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
default_label
);
default_label
);
...
@@ -6299,7 +6295,8 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6299,7 +6295,8 @@ emit_case_nodes (index, node, default_label, index_type)
if they are possible. */
if they are possible. */
if
(
!
node_has_high_bound
(
node
,
index_type
))
if
(
!
node_has_high_bound
(
node
,
index_type
))
{
{
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
VOIDmode
,
0
),
VOIDmode
,
0
),
GT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
GT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
default_label
);
default_label
);
...
@@ -6307,7 +6304,8 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6307,7 +6304,8 @@ emit_case_nodes (index, node, default_label, index_type)
/* Value belongs to this node or to the left-hand subtree. */
/* Value belongs to this node or to the left-hand subtree. */
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
low
,
NULL_RTX
,
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
low
,
NULL_RTX
,
VOIDmode
,
0
),
VOIDmode
,
0
),
GE
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
GE
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
label_rtx
(
node
->
code_label
));
label_rtx
(
node
->
code_label
));
...
@@ -6323,7 +6321,8 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6323,7 +6321,8 @@ emit_case_nodes (index, node, default_label, index_type)
if
(
!
node_has_high_bound
(
node
,
index_type
))
if
(
!
node_has_high_bound
(
node
,
index_type
))
{
{
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
high
,
NULL_RTX
,
VOIDmode
,
0
),
VOIDmode
,
0
),
GT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
GT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
default_label
);
default_label
);
...
@@ -6331,7 +6330,8 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6331,7 +6330,8 @@ emit_case_nodes (index, node, default_label, index_type)
if
(
!
node_has_low_bound
(
node
,
index_type
))
if
(
!
node_has_low_bound
(
node
,
index_type
))
{
{
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
low
,
NULL_RTX
,
emit_cmp_and_jump_insns
(
index
,
expand_expr
(
node
->
low
,
NULL_RTX
,
VOIDmode
,
0
),
VOIDmode
,
0
),
LT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
LT
,
NULL_RTX
,
mode
,
unsignedp
,
0
,
default_label
);
default_label
);
...
@@ -6341,4 +6341,3 @@ emit_case_nodes (index, node, default_label, index_type)
...
@@ -6341,4 +6341,3 @@ emit_case_nodes (index, node, default_label, index_type)
}
}
}
}
}
}
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