+2015-10-23 Olivier Hainque <hainque@adacore.com>
+
+ * tracebak.c: Fallback to generic unwinder for gcc-sjlj on x86 &
+ x86_64 linux
+ * tracebak.c: Rework x86 & x86_64 sections to resort to the
+ generic unwinder if __USING_SJLJ_EXCEPTIONS__.
+
+2015-10-23 Javier Miranda <miranda@adacore.com>
+
+ * sem_util.adb (Check_Function_Writable_Actuals): For function
+ calls restrict the check to elementary types, as requested by
+ RM 6.4.1(6.15/3)
+
+2015-10-23 Arnaud Charlet <charlet@adacore.com>
+
+ * exp_unst.adb (Unnest_Subprogram): Suppress initialization on
+ Decl_ARECnT since we are taking care of all initializations in
+ the generated code.
+
2015-10-23 Ed Schonberg <schonberg@adacore.com>
* sem_dim.adb (Analyze_Dimension_Extension_Or_Record_Aggregate):
-- Now we can insert the AREC declarations into the body
-- type ARECnT is record .. end record;
+ -- pragma Suppress_Initialization (ARECnT);
+ -- Note that we need to set the Suppress_Initialization
+ -- flag after Decl_ARECnT has been analyzed.
Decl_ARECnT :=
Make_Full_Type_Declaration (Loc,
Analyze (Decl_ARECn, Suppress => All_Checks);
Analyze (Decl_ARECnP, Suppress => All_Checks);
+ Set_Suppress_Initialization
+ (Defining_Identifier (Decl_ARECnT));
+
if Present (Decl_Assign) then
Analyze (Decl_Assign, Suppress => All_Checks);
end if;
end if;
if Is_Writable_Actual then
- if Contains (Writable_Actuals_List, N) then
+
+ -- Skip checking the error in non-elementary types since
+ -- RM 6.4.1(6.15/3) is restricted to elementary types, but
+ -- store this actual in Writable_Actuals_List since it is
+ -- needed to perform checks on other constructs that have
+ -- arbitrary order of evaluation (for example, aggregates).
+
+ if not Is_Elementary_Type (Etype (N)) then
+ if not Contains (Writable_Actuals_List, N) then
+ Append_New_Elmt (N, To => Writable_Actuals_List);
+ end if;
+
+ -- Second occurrence of an elementary type writable actual
+
+ elsif Contains (Writable_Actuals_List, N) then
-- Report the error on the second occurrence of the
-- identifier. We cannot assume that N is the second
- -- occurrence, since Traverse_Func walks through Field2
+ -- occurrence (according to their location in the
+ -- sources), since Traverse_Func walks through Field2
-- last (see comment in the body of Traverse_Func).
declare
Error_Node, Id);
return Abandon;
end;
- end if;
- Append_New_Elmt (N, To => Writable_Actuals_List);
+ -- First occurrence of a elementary type writable actual
+
+ else
+ Append_New_Elmt (N, To => Writable_Actuals_List);
+ end if;
else
if Identifiers_List = No_Elist then
window of frame N-1 (positive offset from fp), in which we retrieve the
saved return address. We then end up with our caller's return address. */
-/*------------------------------- x86 ----------------------------------*/
+/*---------------------------- x86 & x86_64 ---------------------------------*/
-#elif defined (__i386__)
+#elif defined (__i386__) || defined (__x86_64__)
#if defined (__WIN32)
#include <windows.h>
#define IS_BAD_PTR(ptr) 0
#endif
-/* Starting with GCC 4.6, -fomit-frame-pointer is turned on by default for
- 32-bit x86/Linux as well and DWARF 2 unwind tables are emitted instead.
- See the x86-64 case below for the drawbacks with this approach. */
-#if defined (__linux__) && (__GNUC__ * 10 + __GNUC_MINOR__ > 45)
+/* Use the dwarf2 unwinder when we expect to have dwarf2 tables at
+ hand. Backtraces will reliably stop on frames missing such tables,
+ but our only alternative is the generic unwinder which requires
+ compilation forcing a frame pointer to be reliable. */
+
+#if defined (__linux__) && !defined (__USING_SJLJ_EXCEPTIONS__)
#define USE_GCC_UNWINDER
#else
#define USE_GENERIC_UNWINDER
};
#define FRAME_LEVEL 1
-/* builtin_frame_address (1) is expected to work on this target, and (0) might
- return the soft stack pointer, which does not designate a location where a
- backchain and a return address might be found. */
+/* builtin_frame_address (1) is expected to work on this family of targets,
+ and (0) might return the soft stack pointer, which does not designate a
+ location where a backchain and a return address might be found. */
#define FRAME_OFFSET(FP) 0
#define PC_ADJUST -2
|| ((*((ptr) - 1) & 0xff) == 0xff) \
|| (((*(ptr) & 0xd0ff) == 0xd0ff))))
-/*----------------------------- x86_64 ---------------------------------*/
-
-#elif defined (__x86_64__)
-
-#define USE_GCC_UNWINDER
-/* The generic unwinder is not used for this target because it is based
- on frame layout assumptions that are not reliable on this target (the
- rbp register is very likely used for something else than storing the
- frame pointer in optimized code). Hence, we use the GCC unwinder
- based on DWARF 2 call frame information, although it has the drawback
- of not being able to unwind through frames compiled without DWARF 2
- information.
-*/
-
-#define PC_ADJUST -2
-/* The minimum size of call instructions on this architecture is 2 bytes */
-
/*----------------------------- ia64 ---------------------------------*/
#elif defined (__ia64__) && (defined (__linux__) || defined (__hpux__))