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
ce1a1562
Commit
ce1a1562
authored
Nov 16, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: don't remove floating point conversion of typed constant
From-SVN: r193565
parent
d761f9e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
gcc/go/gofrontend/expressions.cc
+40
-0
No files found.
gcc/go/gofrontend/expressions.cc
View file @
ce1a1562
...
@@ -2962,6 +2962,46 @@ Type_conversion_expression::do_lower(Gogo*, Named_object*,
...
@@ -2962,6 +2962,46 @@ Type_conversion_expression::do_lower(Gogo*, Named_object*,
{
{
if
(
!
nc
.
set_type
(
type
,
true
,
location
))
if
(
!
nc
.
set_type
(
type
,
true
,
location
))
return
Expression
::
make_error
(
location
);
return
Expression
::
make_error
(
location
);
// Don't simply convert to or from a float or complex type
// with a different size. That may change the value.
Type
*
vtype
=
val
->
type
();
if
(
vtype
->
is_abstract
())
;
else
if
(
type
->
float_type
()
!=
NULL
)
{
if
(
vtype
->
float_type
()
!=
NULL
)
{
if
(
type
->
float_type
()
->
bits
()
!=
vtype
->
float_type
()
->
bits
())
return
this
;
}
else
if
(
vtype
->
complex_type
()
!=
NULL
)
{
if
(
type
->
float_type
()
->
bits
()
*
2
!=
vtype
->
complex_type
()
->
bits
())
return
this
;
}
}
else
if
(
type
->
complex_type
()
!=
NULL
)
{
if
(
vtype
->
complex_type
()
!=
NULL
)
{
if
(
type
->
complex_type
()
->
bits
()
!=
vtype
->
complex_type
()
->
bits
())
return
this
;
}
else
if
(
vtype
->
float_type
()
!=
NULL
)
{
if
(
type
->
complex_type
()
->
bits
()
!=
vtype
->
float_type
()
->
bits
()
*
2
)
return
this
;
}
}
else
if
(
vtype
->
float_type
()
!=
NULL
)
return
this
;
else
if
(
vtype
->
complex_type
()
!=
NULL
)
return
this
;
return
nc
.
expression
(
location
);
return
nc
.
expression
(
location
);
}
}
}
}
...
...
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