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
b39e1240
Commit
b39e1240
authored
Jan 09, 2000
by
Nick Clifton
Committed by
Nick Clifton
Jan 09, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile time warnings about signed vs unsigned constants
From-SVN: r31298
parent
3a5a4282
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
29 deletions
+36
-29
gcc/ChangeLog
+7
-0
gcc/config/arm/arm.c
+26
-26
gcc/config/arm/arm.h
+3
-3
No files found.
gcc/ChangeLog
View file @
b39e1240
2000
-
01
-
09
Nick
Clifton
<
nickc
@cygnus
.
com
>
*
config
/
arm
/
arm
.
c
:
Fix
compile
time
warnings
about
signed
vs
unsigned
constants
.
*
config
/
arm
/
arm
.
h
:
Fix
compile
time
warnings
about
signed
vs
unsigned
constants
.
2000
-
01
-
09
Philip
Blundell
<
philb
@gnu
.
org
>
2000
-
01
-
09
Philip
Blundell
<
philb
@gnu
.
org
>
*
config
/
arm
/
arm
.
c
(
output_return_instruction
)
:
Use
`
ldr
'
rather
*
config
/
arm
/
arm
.
c
(
output_return_instruction
)
:
Use
`
ldr
'
rather
...
...
gcc/config/arm/arm.c
View file @
b39e1240
...
@@ -658,10 +658,10 @@ const_ok_for_arm (i)
...
@@ -658,10 +658,10 @@ const_ok_for_arm (i)
/* For machines with >32 bit HOST_WIDE_INT, the bits above bit 31 must
/* For machines with >32 bit HOST_WIDE_INT, the bits above bit 31 must
be all zero, or all one. */
be all zero, or all one. */
if
((
i
&
~
(
unsigned
HOST_WIDE_INT
)
0xffffffff
)
!=
0
if
((
i
&
~
(
unsigned
HOST_WIDE_INT
)
0xffffffff
UL
)
!=
0
&&
((
i
&
~
(
unsigned
HOST_WIDE_INT
)
0xffffffff
)
&&
((
i
&
~
(
unsigned
HOST_WIDE_INT
)
0xffffffff
UL
)
!=
((
~
(
unsigned
HOST_WIDE_INT
)
0
)
!=
((
~
(
unsigned
HOST_WIDE_INT
)
0
)
&
~
(
unsigned
HOST_WIDE_INT
)
0xffffffff
)))
&
~
(
unsigned
HOST_WIDE_INT
)
0xffffffff
UL
)))
return
FALSE
;
return
FALSE
;
/* Fast return for 0 and powers of 2 */
/* Fast return for 0 and powers of 2 */
...
@@ -670,11 +670,11 @@ const_ok_for_arm (i)
...
@@ -670,11 +670,11 @@ const_ok_for_arm (i)
do
do
{
{
if
((
i
&
mask
&
(
unsigned
HOST_WIDE_INT
)
0xffffffff
)
==
0
)
if
((
i
&
mask
&
(
unsigned
HOST_WIDE_INT
)
0xffffffff
UL
)
==
0
)
return
TRUE
;
return
TRUE
;
mask
=
mask
=
(
mask
<<
2
)
|
((
mask
&
(
unsigned
HOST_WIDE_INT
)
0xffffffff
)
(
mask
<<
2
)
|
((
mask
&
(
unsigned
HOST_WIDE_INT
)
0xffffffff
UL
)
>>
(
32
-
2
))
|
~
((
unsigned
HOST_WIDE_INT
)
0xffffffff
);
>>
(
32
-
2
))
|
~
((
unsigned
HOST_WIDE_INT
)
0xffffffff
UL
);
}
while
(
mask
!=
~
(
unsigned
HOST_WIDE_INT
)
0xFF
);
}
while
(
mask
!=
~
(
unsigned
HOST_WIDE_INT
)
0xFF
);
return
FALSE
;
return
FALSE
;
...
@@ -795,7 +795,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
...
@@ -795,7 +795,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
int
set_zero_bit_copies
=
0
;
int
set_zero_bit_copies
=
0
;
int
insns
=
0
;
int
insns
=
0
;
unsigned
HOST_WIDE_INT
temp1
,
temp2
;
unsigned
HOST_WIDE_INT
temp1
,
temp2
;
unsigned
HOST_WIDE_INT
remainder
=
val
&
0xffffffff
;
unsigned
HOST_WIDE_INT
remainder
=
val
&
0xffffffff
UL
;
/* find out which operations are safe for a given CODE. Also do a quick
/* find out which operations are safe for a given CODE. Also do a quick
check for degenerate cases; these can occur when DImode operations
check for degenerate cases; these can occur when DImode operations
...
@@ -814,7 +814,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
...
@@ -814,7 +814,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
break
;
break
;
case
IOR
:
case
IOR
:
if
(
remainder
==
0xffffffff
)
if
(
remainder
==
0xffffffff
UL
)
{
{
if
(
generate
)
if
(
generate
)
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
target
,
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
target
,
...
@@ -838,7 +838,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
...
@@ -838,7 +838,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
target
,
const0_rtx
));
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
target
,
const0_rtx
));
return
1
;
return
1
;
}
}
if
(
remainder
==
0xffffffff
)
if
(
remainder
==
0xffffffff
UL
)
{
{
if
(
reload_completed
&&
rtx_equal_p
(
target
,
source
))
if
(
reload_completed
&&
rtx_equal_p
(
target
,
source
))
return
0
;
return
0
;
...
@@ -858,7 +858,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
...
@@ -858,7 +858,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
target
,
source
));
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
target
,
source
));
return
1
;
return
1
;
}
}
if
(
remainder
==
0xffffffff
)
if
(
remainder
==
0xffffffff
UL
)
{
{
if
(
generate
)
if
(
generate
)
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
target
,
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
target
,
...
@@ -988,15 +988,15 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
...
@@ -988,15 +988,15 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
word. We only look for the simplest cases, to do more would cost
word. We only look for the simplest cases, to do more would cost
too much. Be careful, however, not to generate this when the
too much. Be careful, however, not to generate this when the
alternative would take fewer insns. */
alternative would take fewer insns. */
if
(
val
&
0xffff0000
)
if
(
val
&
0xffff0000
UL
)
{
{
temp1
=
remainder
&
0xffff0000
;
temp1
=
remainder
&
0xffff0000
UL
;
temp2
=
remainder
&
0x0000ffff
;
temp2
=
remainder
&
0x0000ffff
;
/* Overlaps outside this range are best done using other methods. */
/* Overlaps outside this range are best done using other methods. */
for
(
i
=
9
;
i
<
24
;
i
++
)
for
(
i
=
9
;
i
<
24
;
i
++
)
{
{
if
((((
temp2
|
(
temp2
<<
i
))
&
0xffffffff
)
==
remainder
)
if
((((
temp2
|
(
temp2
<<
i
))
&
0xffffffff
UL
)
==
remainder
)
&&
!
const_ok_for_arm
(
temp2
))
&&
!
const_ok_for_arm
(
temp2
))
{
{
rtx
new_src
=
(
subtargets
rtx
new_src
=
(
subtargets
...
@@ -1134,11 +1134,11 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
...
@@ -1134,11 +1134,11 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
/* See if two shifts will do 2 or more insn's worth of work. */
/* See if two shifts will do 2 or more insn's worth of work. */
if
(
clear_sign_bit_copies
>=
16
&&
clear_sign_bit_copies
<
24
)
if
(
clear_sign_bit_copies
>=
16
&&
clear_sign_bit_copies
<
24
)
{
{
HOST_WIDE_INT
shift_mask
=
((
0xffffffff
HOST_WIDE_INT
shift_mask
=
((
0xffffffff
UL
<<
(
32
-
clear_sign_bit_copies
))
<<
(
32
-
clear_sign_bit_copies
))
&
0xffffffff
);
&
0xffffffff
UL
);
if
((
remainder
|
shift_mask
)
!=
0xffffffff
)
if
((
remainder
|
shift_mask
)
!=
0xffffffff
UL
)
{
{
if
(
generate
)
if
(
generate
)
{
{
...
@@ -1171,7 +1171,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
...
@@ -1171,7 +1171,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
{
{
HOST_WIDE_INT
shift_mask
=
(
1
<<
clear_zero_bit_copies
)
-
1
;
HOST_WIDE_INT
shift_mask
=
(
1
<<
clear_zero_bit_copies
)
-
1
;
if
((
remainder
|
shift_mask
)
!=
0xffffffff
)
if
((
remainder
|
shift_mask
)
!=
0xffffffff
UL
)
{
{
if
(
generate
)
if
(
generate
)
{
{
...
@@ -1213,9 +1213,9 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
...
@@ -1213,9 +1213,9 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
num_bits_set
++
;
num_bits_set
++
;
if
(
code
==
AND
||
(
can_invert
&&
num_bits_set
>
16
))
if
(
code
==
AND
||
(
can_invert
&&
num_bits_set
>
16
))
remainder
=
(
~
remainder
)
&
0xffffffff
;
remainder
=
(
~
remainder
)
&
0xffffffff
UL
;
else
if
(
code
==
PLUS
&&
num_bits_set
>
16
)
else
if
(
code
==
PLUS
&&
num_bits_set
>
16
)
remainder
=
(
-
remainder
)
&
0xffffffff
;
remainder
=
(
-
remainder
)
&
0xffffffff
UL
;
else
else
{
{
can_invert
=
0
;
can_invert
=
0
;
...
@@ -1809,7 +1809,7 @@ arm_rtx_costs (x, code)
...
@@ -1809,7 +1809,7 @@ arm_rtx_costs (x, code)
if
(
GET_CODE
(
XEXP
(
x
,
1
))
==
CONST_INT
)
if
(
GET_CODE
(
XEXP
(
x
,
1
))
==
CONST_INT
)
{
{
unsigned
HOST_WIDE_INT
i
=
(
INTVAL
(
XEXP
(
x
,
1
))
unsigned
HOST_WIDE_INT
i
=
(
INTVAL
(
XEXP
(
x
,
1
))
&
(
unsigned
HOST_WIDE_INT
)
0xffffffff
);
&
(
unsigned
HOST_WIDE_INT
)
0xffffffff
UL
);
int
add_cost
=
const_ok_for_arm
(
i
)
?
4
:
8
;
int
add_cost
=
const_ok_for_arm
(
i
)
?
4
:
8
;
int
j
;
int
j
;
/* Tune as appropriate */
/* Tune as appropriate */
...
@@ -3764,9 +3764,9 @@ arm_reload_in_hi (operands)
...
@@ -3764,9 +3764,9 @@ arm_reload_in_hi (operands)
if
(
lo
==
4095
)
if
(
lo
==
4095
)
lo
&=
0x7ff
;
lo
&=
0x7ff
;
hi
=
((((
offset
-
lo
)
&
(
HOST_WIDE_INT
)
0xFFFFFFFF
)
hi
=
((((
offset
-
lo
)
&
(
HOST_WIDE_INT
)
0xFFFFFFFF
UL
)
^
(
HOST_WIDE_INT
)
0x80000000
)
^
(
HOST_WIDE_INT
)
0x80000000
UL
)
-
(
HOST_WIDE_INT
)
0x80000000
);
-
(
HOST_WIDE_INT
)
0x80000000
UL
);
if
(
hi
+
lo
!=
offset
)
if
(
hi
+
lo
!=
offset
)
abort
();
abort
();
...
@@ -3910,9 +3910,9 @@ arm_reload_out_hi (operands)
...
@@ -3910,9 +3910,9 @@ arm_reload_out_hi (operands)
if
(
lo
==
4095
)
if
(
lo
==
4095
)
lo
&=
0x7ff
;
lo
&=
0x7ff
;
hi
=
((((
offset
-
lo
)
&
(
HOST_WIDE_INT
)
0xFFFFFFFF
)
hi
=
((((
offset
-
lo
)
&
(
HOST_WIDE_INT
)
0xFFFFFFFF
UL
)
^
(
HOST_WIDE_INT
)
0x80000000
)
^
(
HOST_WIDE_INT
)
0x80000000
UL
)
-
(
HOST_WIDE_INT
)
0x80000000
);
-
(
HOST_WIDE_INT
)
0x80000000
UL
);
if
(
hi
+
lo
!=
offset
)
if
(
hi
+
lo
!=
offset
)
abort
();
abort
();
...
...
gcc/config/arm/arm.h
View file @
b39e1240
...
@@ -2041,10 +2041,10 @@ extern struct rtx_def * arm_compare_op1;
...
@@ -2041,10 +2041,10 @@ extern struct rtx_def * arm_compare_op1;
#define ARM_SIGN_EXTEND(x) ((HOST_WIDE_INT) \
#define ARM_SIGN_EXTEND(x) ((HOST_WIDE_INT) \
(HOST_BITS_PER_WIDE_INT <= 32 ? (x) \
(HOST_BITS_PER_WIDE_INT <= 32 ? (x) \
: (((x) & (unsigned HOST_WIDE_INT) 0xffffffff) | \
: (((x) & (unsigned HOST_WIDE_INT) 0xffffffff
UL
) | \
(((x) & (unsigned HOST_WIDE_INT) 0x80000000) \
(((x) & (unsigned HOST_WIDE_INT) 0x80000000
UL
) \
? ((~ (HOST_WIDE_INT) 0) \
? ((~ (HOST_WIDE_INT) 0) \
& ~ (unsigned HOST_WIDE_INT) 0xffffffff) \
& ~ (unsigned HOST_WIDE_INT) 0xffffffff
UL
) \
: 0))))
: 0))))
/* Output the address of an operand. */
/* Output the address of an operand. */
...
...
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