* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230878
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
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;
-- 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;
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
int
__gnat_inum_to_ivec (int num)
{
- return (int) INUM_TO_IVEC (num);
+ return (int) ((long) INUM_TO_IVEC ((long) num));
}
#endif
#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);
#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
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,
=>
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 =>
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;
Result := Defining_Identifier (Result);
exit;
+ when N_Task_Body =>
+ Result := Defining_Identifier (Result);
+ exit;
+
when others =>
Result := Parent (Result);
end case;
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