aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-10-26 13:03:29 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-26 13:03:29 +0100
commit638f50548143c46e32bca3b9e38bfc8e9251672b (patch)
tree4a8b54474e773e468dd4769af6852f425578bf66 /gcc
parentb30fc1f9d6ca2ad28b3c136e88049a285533df8f (diff)
downloadgcc-638f50548143c46e32bca3b9e38bfc8e9251672b.zip
gcc-638f50548143c46e32bca3b9e38bfc8e9251672b.tar.gz
gcc-638f50548143c46e32bca3b9e38bfc8e9251672b.tar.bz2
[multiple changes]
2015-10-26 Javier Miranda <miranda@adacore.com> * exp_ch6.adb (Expand_N_Subprogram_Declaration): Skip the frontend transformation of functions that return a constrained array into a procedure when they are unchecked_conversion instances. 2015-10-26 Gary Dismukes <dismukes@adacore.com> * s-os_lib.ads: Minor reformatting/rewording. From-SVN: r229350
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog10
-rw-r--r--gcc/ada/exp_ch6.adb5
-rw-r--r--gcc/ada/s-os_lib.ads14
3 files changed, 21 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b19076c..1da9491 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,13 @@
+2015-10-26 Javier Miranda <miranda@adacore.com>
+
+ * exp_ch6.adb (Expand_N_Subprogram_Declaration): Skip the frontend
+ transformation of functions that return a constrained array into
+ a procedure when they are unchecked_conversion instances.
+
+2015-10-26 Gary Dismukes <dismukes@adacore.com>
+
+ * s-os_lib.ads: Minor reformatting/rewording.
+
2015-10-26 Arnaud Charlet <charlet@adacore.com>
* debug.adb: Introduce debug flag -gnatd.5.
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index a666ab2..b848858 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -5666,10 +5666,15 @@ package body Exp_Ch6 is
-- constrained array type into a procedure with an out parameter
-- that carries the return value.
+ -- We skip this transformation for unchecked conversions, since they
+ -- are not needed by the C generator (and this also produces cleaner
+ -- output).
+
if Modify_Tree_For_C
and then Nkind (Specification (N)) = N_Function_Specification
and then Is_Array_Type (Etype (Subp))
and then Is_Constrained (Etype (Subp))
+ and then not Is_Unchecked_Conversion_Instance (Subp)
then
Build_Procedure_Form;
end if;
diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads
index e9bb9bf..4c03c70 100644
--- a/gcc/ada/s-os_lib.ads
+++ b/gcc/ada/s-os_lib.ads
@@ -877,14 +877,12 @@ package System.OS_Lib is
-- there is no notion of executables under this OS.
procedure Kill (Pid : Process_Id; Hard_Kill : Boolean := True);
- -- Kill process known as Pid by the OS. Does nothing if Pid is
- -- Invalid_Pid or on platforms where it is not supported like
- -- VxWorks.
- -- Hard_Kill is True by default and in this case the process
- -- is terminated immediately. If Hard_Kill is False a signal
- -- SIGINT is sent to the process on POSIX OS or a CTRL-C event
- -- on Windows, this let the process a chance to quit properly
- -- using a corresponding handler.
+ -- Kill the process designated by Pid. Does nothing if Pid is Invalid_Pid
+ -- or on platforms where it is not supported, such as VxWorks. Hard_Kill
+ -- is True by default, and when True the process is terminated immediately.
+ -- If Hard_Kill is False, then a signal SIGINT is sent to the process on
+ -- POSIX OS or a ctrl-C event on Windows, allowing the process a chance to
+ -- terminate properly using a corresponding handler.
function Argument_String_To_List
(Arg_String : String) return Argument_List_Access;