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
d6394e2b
Commit
d6394e2b
authored
Oct 10, 2013
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Fix test for constant argument too large for make.
From-SVN: r203338
parent
3d317d48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
gcc/go/gofrontend/expressions.cc
+17
-2
No files found.
gcc/go/gofrontend/expressions.cc
View file @
d6394e2b
...
...
@@ -7542,7 +7542,7 @@ Builtin_call_expression::check_int_value(Expression* e, bool is_length)
switch
(
nc
.
to_unsigned_long
(
&
v
))
{
case
Numeric_constant
:
:
NC_UL_VALID
:
return
true
;
break
;
case
Numeric_constant
:
:
NC_UL_NOTINT
:
error_at
(
e
->
location
(),
"non-integer %s argument to make"
,
is_length
?
"len"
:
"cap"
);
...
...
@@ -7554,8 +7554,23 @@ Builtin_call_expression::check_int_value(Expression* e, bool is_length)
case
Numeric_constant
:
:
NC_UL_BIG
:
// We don't want to give a compile-time error for a 64-bit
// value on a 32-bit target.
return
true
;
break
;
}
mpz_t
val
;
if
(
!
nc
.
to_int
(
&
val
))
go_unreachable
();
int
bits
=
mpz_sizeinbase
(
val
,
2
);
mpz_clear
(
val
);
Type
*
int_type
=
Type
::
lookup_integer_type
(
"int"
);
if
(
bits
>=
int_type
->
integer_type
()
->
bits
())
{
error_at
(
e
->
location
(),
"%s argument too large for make"
,
is_length
?
"len"
:
"cap"
);
return
false
;
}
return
true
;
}
if
(
e
->
type
()
->
integer_type
()
!=
NULL
)
...
...
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