aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-11-25 16:16:44 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2015-11-25 16:16:44 +0100
commit7b52257cfa555812c6755dd69f21ee92e7d2bd5b (patch)
tree8d535f154978a199ca451ad1d97e0e1958f471f5 /gcc/ada
parente9c12b91f480ce15810dc0be2afc174899f4eea7 (diff)
downloadgcc-7b52257cfa555812c6755dd69f21ee92e7d2bd5b.zip
gcc-7b52257cfa555812c6755dd69f21ee92e7d2bd5b.tar.gz
gcc-7b52257cfa555812c6755dd69f21ee92e7d2bd5b.tar.bz2
[multiple changes]
2015-11-25 Arnaud Charlet <charlet@adacore.com> * exp_util.adb (Remove_Side_Effects): Minimize extra temporaries and use of 'Reference when needed. 2015-11-25 Doug Rupp <rupp@adacore.com> * sigtramp-vxworks-target.inc (__x86_64__): Restore context for the sake of uniformity. * init.c (__gnat_inum_to_ivec): Add some casting to avoid warnings when sizeof(long) != sizeof(int) 2015-11-25 Yannick Moy <moy@adacore.com> * lib-xref-spark_specific.adb (SPARK_Entities): Add entries for consideration. (Add_SPARK_Scope): Take tasks into account. (Detect_And_Add_SPARK_Scope): Take tasks into account. (Enclosing_Subprogram_Or_Library_Package): Take tasks into account. From-SVN: r230878
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog20
-rw-r--r--gcc/ada/exp_util.adb15
-rw-r--r--gcc/ada/init.c10
-rw-r--r--gcc/ada/lib-xref-spark_specific.adb22
-rw-r--r--gcc/ada/sigtramp-vxworks-target.inc1
5 files changed, 51 insertions, 17 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 19ddd9f..db50698 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,23 @@
+2015-11-25 Arnaud Charlet <charlet@adacore.com>
+
+ * exp_util.adb (Remove_Side_Effects): Minimize extra temporaries
+ and use of 'Reference when needed.
+
+2015-11-25 Doug Rupp <rupp@adacore.com>
+
+ * sigtramp-vxworks-target.inc (__x86_64__): Restore context for the
+ sake of uniformity.
+ * init.c (__gnat_inum_to_ivec): Add some casting to avoid
+ warnings when sizeof(long) != sizeof(int)
+
+2015-11-25 Yannick Moy <moy@adacore.com>
+
+ * lib-xref-spark_specific.adb (SPARK_Entities): Add entries for
+ consideration.
+ (Add_SPARK_Scope): Take tasks into account.
+ (Detect_And_Add_SPARK_Scope): Take tasks into account.
+ (Enclosing_Subprogram_Or_Library_Package): Take tasks into account.
+
2015-11-25 Bob Duff <duff@adacore.com>
* sem_elab.adb (Check_Internal_Call_Continue): Code clean ups.
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 3d534bd..55836e1 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -7816,9 +7816,10 @@ package body Exp_Util is
else
-- An expression which is in SPARK mode is considered side effect
-- free if the resulting value is captured by a variable or a
- -- constant.
+ -- constant. Same reasoning when generating C code.
+ -- Why can't we apply this test in general???
- if GNATprove_Mode
+ if (GNATprove_Mode or Generate_C_Code)
and then Nkind (Parent (Exp)) = N_Object_Declaration
then
goto Leave;
@@ -7862,8 +7863,10 @@ package body Exp_Util is
-- the secondary stack. Since SPARK (and why) cannot process access
-- types, use a different approach which ignores the secondary stack
-- and "copies" the returned object.
+ -- When generating C code, no need for a 'reference since the
+ -- secondary stack is not supported.
- if GNATprove_Mode then
+ if GNATprove_Mode or Generate_C_Code then
Res := New_Occurrence_Of (Def_Id, Loc);
Ref_Type := Exp_Type;
@@ -7898,10 +7901,10 @@ package body Exp_Util is
else
E := Relocate_Node (E);
- -- Do not generate a 'reference in SPARK mode since the access
- -- type is not created in the first place.
+ -- Do not generate a 'reference in SPARK mode or C generation
+ -- since the access type is not created in the first place.
- if GNATprove_Mode then
+ if GNATprove_Mode or Generate_C_Code then
New_Exp := E;
-- Otherwise generate reference, marking the value as non-null
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 06e366d..2f01c8d 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -1732,7 +1732,7 @@ extern int __gnat_inum_to_ivec (int);
int
__gnat_inum_to_ivec (int num)
{
- return (int) INUM_TO_IVEC (num);
+ return (int) ((long) INUM_TO_IVEC ((long) num));
}
#endif
@@ -1985,14 +1985,14 @@ __gnat_error_handler (int sig, siginfo_t *si, void *sc)
#ifdef HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
/* We need to sometimes to adjust the PC in case of signals so that it
doesn't reference the exception that actually raised the signal but the
- instruction before it. */
+ instruction before it. */
__gnat_adjust_context_for_raise (sig, sc);
#endif
#if defined (__i386__) && !defined (VTHREADS) && (__WRS_VXWORKS_MAJOR < 7)
/* On x86, the vxsim signal context is subtly different and is processeed
by a handler compiled especially for vxsim.
- Vxsim is not supported anymore on our vxworks-7 port. */
+ Vxsim is not supported anymore on our vxworks-7 port. */
if (is_vxsim)
__gnat_vxsim_error_handler (sig, si, sc);
@@ -2115,9 +2115,9 @@ __gnat_init_float (void)
#endif
#endif
-#if defined (__i386__) && !defined (VTHREADS)
+#if (defined (__i386__) && !defined (VTHREADS))
/* This is used to properly initialize the FPU on an x86 for each
- process thread. */
+ process thread. Is this needed for x86_64 ??? */
asm ("finit");
#endif
diff --git a/gcc/ada/lib-xref-spark_specific.adb b/gcc/ada/lib-xref-spark_specific.adb
index 43a0237..b570725 100644
--- a/gcc/ada/lib-xref-spark_specific.adb
+++ b/gcc/ada/lib-xref-spark_specific.adb
@@ -40,6 +40,7 @@ package body SPARK_Specific is
SPARK_Entities : constant array (Entity_Kind) of Boolean :=
(E_Constant => True,
+ E_Entry => True,
E_Function => True,
E_In_Out_Parameter => True,
E_In_Parameter => True,
@@ -268,7 +269,7 @@ package body SPARK_Specific is
=>
Typ := Xref_Entity_Letters (Ekind (E));
- when E_Package_Body | E_Subprogram_Body =>
+ when E_Package_Body | E_Subprogram_Body | E_Task_Body =>
Typ := Xref_Entity_Letters (Ekind (Unique_Entity (E)));
when E_Void =>
@@ -1006,14 +1007,19 @@ package body SPARK_Specific is
procedure Detect_And_Add_SPARK_Scope (N : Node_Id) is
begin
- if Nkind_In (N, N_Entry_Body,
- N_Entry_Declaration,
- N_Package_Body,
+ if Nkind_In (N, N_Entry_Body, -- entries
+ N_Entry_Declaration)
+ or else
+ Nkind_In (N, N_Package_Body, -- packages
N_Package_Body_Stub,
- N_Package_Declaration,
- N_Subprogram_Body,
+ N_Package_Declaration)
+ or else
+ Nkind_In (N, N_Subprogram_Body, -- subprograms
N_Subprogram_Body_Stub,
N_Subprogram_Declaration)
+ or else
+ Nkind_In (N, N_Task_Body, -- tasks
+ N_Task_Body_Stub)
then
Add_SPARK_Scope (N);
end if;
@@ -1105,6 +1111,10 @@ package body SPARK_Specific is
Result := Defining_Identifier (Result);
exit;
+ when N_Task_Body =>
+ Result := Defining_Identifier (Result);
+ exit;
+
when others =>
Result := Parent (Result);
end case;
diff --git a/gcc/ada/sigtramp-vxworks-target.inc b/gcc/ada/sigtramp-vxworks-target.inc
index fbb708b..a031360 100644
--- a/gcc/ada/sigtramp-vxworks-target.inc
+++ b/gcc/ada/sigtramp-vxworks-target.inc
@@ -441,6 +441,7 @@ TCR("# Call the real handler. The signo, siginfo and sigcontext") \
TCR("# arguments are the same as those we received") \
TCR("call *%rcx") \
TCR("# This part should never be executed") \
+TCR("addq $8, %rsp") \
TCR("ret")
#else