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
0b9cdb9a
Commit
0b9cdb9a
authored
Feb 24, 2017
by
Eric Botcazou
Committed by
Eric Botcazou
Feb 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
From-SVN: r245701
parent
59909673
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
0 deletions
+34
-0
gcc/ada/ChangeLog
+4
-0
gcc/ada/gcc-interface/trans.c
+7
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gnat.dg/opt63.adb
+19
-0
No files found.
gcc/ada/ChangeLog
View file @
0b9cdb9a
2017
-
02
-
24
Eric
Botcazou
<
ebotcazou
@
adacore
.
com
>
*
gcc
-
interface
/
trans
.
c
(
return_value_ok_for_nrv_p
):
Add
sanity
check
.
2017
-
02
-
24
Eric
Botcazou
<
ebotcazou
@
adacore
.
com
>
*
gcc
-
interface
/
decl
.
c
:
Include
demangle
.
h
.
(
is_cplusplus_method
):
Return
again
true
for
a
primitive
operation
only
if
it
is
dispatching
.
For
a
subprogram
with
an
interface
name
,
...
...
gcc/ada/gcc-interface/trans.c
View file @
0b9cdb9a
...
...
@@ -3614,9 +3614,16 @@ return_value_ok_for_nrv_p (tree ret_obj, tree ret_val)
if
(
TREE_ADDRESSABLE
(
ret_val
))
return
false
;
/* For the constrained case, test for overalignment. */
if
(
ret_obj
&&
DECL_ALIGN
(
ret_val
)
>
DECL_ALIGN
(
ret_obj
))
return
false
;
/* For the unconstrained case, test for bogus initialization. */
if
(
!
ret_obj
&&
DECL_INITIAL
(
ret_val
)
&&
TREE_CODE
(
DECL_INITIAL
(
ret_val
))
==
NULL_EXPR
)
return
false
;
return
true
;
}
...
...
gcc/testsuite/ChangeLog
View file @
0b9cdb9a
2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/opt63.adb: New test.
2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/discr47.adb: New test.
2017-02-24 Richard Biener <rguenther@suse.de>
...
...
gcc/testsuite/gnat.dg/opt63.adb
0 → 100644
View file @
0b9cdb9a
-- { dg-do compile }
-- { dg-options "-O -gnatws" }
procedure Opt63 is
type T_MOD is mod 2**32;
subtype T_INDEX is T_MOD range 3_000_000_000 .. 4_000_000_000;
type T_ARRAY is array(T_INDEX range <>) of INTEGER;
function Build_Crash(First : T_INDEX; Length : NATURAL) return T_ARRAY is
R : T_ARRAY(First .. T_Index'Val (T_Index'Pos (First) + Length))
:= (others => -1); -- Crash here
begin
return R;
end;
begin
null;
end;
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