From: Pierre-Marie de Rodat Date: Thu, 16 Nov 2017 10:23:12 +0000 (+0000) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1554ed7ea429be444e74d5306be6692f517acf02;p=gcc.git [multiple changes] 2017-11-16 Yannick Moy * sem_elab.adb (Include): Fix mode of parameter Curr to out. 2017-11-16 Piotr Trojanek * sem_util.ads, sem_util.adb (Is_CCT_Instance): Allow calls where Context_Id denotes a record type. 2017-11-16 Hristian Kirtchev * sem_ch8.adb (Check_SPARK_Primitive_Operation): Enable the check in instantiations. 2017-11-16 Doug Rupp Initial gnat port to aarch64-wrs-vxworks7 * libgnarl/s-vxwork__aarch64.ads, libgnat/system-vxworks7-aarch64-rtp-smp.ads, libgnat/system-vxworks7-aarch64.ads: New files * sigtramp-vxworks-target.inc (aarch64): New section. * tracebak.c (USE_ARM_UNWINDING): Disable for ARMARCH8A. From-SVN: r254805 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9306265edb5..3f1e51f4acf 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,26 @@ +2017-11-16 Yannick Moy + + * sem_elab.adb (Include): Fix mode of parameter Curr to out. + +2017-11-16 Piotr Trojanek + + * sem_util.ads, sem_util.adb (Is_CCT_Instance): Allow calls where + Context_Id denotes a record type. + +2017-11-16 Hristian Kirtchev + + * sem_ch8.adb (Check_SPARK_Primitive_Operation): Enable the check in + instantiations. + +2017-11-16 Doug Rupp + + Initial gnat port to aarch64-wrs-vxworks7 + * libgnarl/s-vxwork__aarch64.ads, + libgnat/system-vxworks7-aarch64-rtp-smp.ads, + libgnat/system-vxworks7-aarch64.ads: New files + * sigtramp-vxworks-target.inc (aarch64): New section. + * tracebak.c (USE_ARM_UNWINDING): Disable for ARMARCH8A. + 2017-11-16 Hristian Kirtchev * sem_elab.adb (Include): Including a node which is also a compilation diff --git a/gcc/ada/libgnarl/s-vxwork__aarch64.ads b/gcc/ada/libgnarl/s-vxwork__aarch64.ads new file mode 100644 index 00000000000..3edfe16e7a1 --- /dev/null +++ b/gcc/ada/libgnarl/s-vxwork__aarch64.ads @@ -0,0 +1,61 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- +-- -- +-- S Y S T E M . V X W O R K S -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 1998-2017, Free Software Foundation, Inc. -- +-- -- +-- GNARL is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- . -- +-- -- +-- GNARL was developed by the GNARL team at Florida State University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This is the AARCH64 VxWorks version of this package + +with Interfaces.C; + +package System.VxWorks is + pragma Preelaborate (System.VxWorks); + + package IC renames Interfaces.C; + + -- Floating point context record. ARM version + + type ulong128 is array (0 .. 1) of IC.unsigned_long; + FP_SGPR_NUM_REGS : constant := 32; + type Fpr_Sgpr_Array is array (1 .. FP_SGPR_NUM_REGS) of ulong128; + + -- The record definition below matches what arch/arm/fppArmLib.h says + + type FP_CONTEXT is record + fpcr : IC.unsigned_long; -- Floating-point Control Register + fpsr : IC.unsigned_long; -- Floating-point Status Register + vfp_gpr : Fpr_Sgpr_Array; + end record; + + for FP_CONTEXT'Alignment use 16; -- 128 bits + pragma Convention (C, FP_CONTEXT); + + Num_HW_Interrupts : constant := 256; + -- Number of entries in hardware interrupt vector table + +end System.VxWorks; diff --git a/gcc/ada/libgnat/system-vxworks7-aarch64-rtp-smp.ads b/gcc/ada/libgnat/system-vxworks7-aarch64-rtp-smp.ads new file mode 100644 index 00000000000..6122af745d8 --- /dev/null +++ b/gcc/ada/libgnat/system-vxworks7-aarch64-rtp-smp.ads @@ -0,0 +1,171 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M -- +-- -- +-- S p e c -- +-- (VxWorks 7.x AARCH64 RTP) -- +-- -- +-- Copyright (C) 1992-2017, Free Software Foundation, Inc. -- +-- -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. The copyright notice above, and the license provisions that follow -- +-- apply solely to the contents of the part following the private keyword. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This is the VxWorks 7.x version of this package for AARCH64 RTP + +package System is + pragma Pure; + -- Note that we take advantage of the implementation permission to make + -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada + -- 2005, this is Pure in any case (AI-362). + + pragma No_Elaboration_Code_All; + -- Allow the use of that restriction in units that WITH this unit + + type Name is (SYSTEM_NAME_GNAT); + System_Name : constant Name := SYSTEM_NAME_GNAT; + + -- System-Dependent Named Numbers + + Min_Int : constant := Long_Long_Integer'First; + Max_Int : constant := Long_Long_Integer'Last; + + Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; + Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; + + Max_Base_Digits : constant := Long_Long_Float'Digits; + Max_Digits : constant := Long_Long_Float'Digits; + + Max_Mantissa : constant := 63; + Fine_Delta : constant := 2.0 ** (-Max_Mantissa); + + Tick : constant := 1.0 / 60.0; + + -- Storage-related Declarations + + type Address is private; + pragma Preelaborable_Initialization (Address); + Null_Address : constant Address; + + Storage_Unit : constant := 8; + Word_Size : constant := 64; + Memory_Size : constant := 2 ** 64; + + -- Address comparison + + function "<" (Left, Right : Address) return Boolean; + function "<=" (Left, Right : Address) return Boolean; + function ">" (Left, Right : Address) return Boolean; + function ">=" (Left, Right : Address) return Boolean; + function "=" (Left, Right : Address) return Boolean; + + pragma Import (Intrinsic, "<"); + pragma Import (Intrinsic, "<="); + pragma Import (Intrinsic, ">"); + pragma Import (Intrinsic, ">="); + pragma Import (Intrinsic, "="); + + -- Other System-Dependent Declarations + + type Bit_Order is (High_Order_First, Low_Order_First); + Default_Bit_Order : constant Bit_Order := Low_Order_First; + pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning + + -- Priority-related Declarations (RM D.1) + + -- Ada priorities are mapped to VxWorks priorities using the following + -- transformation: 255 - Ada Priority + + -- Ada priorities are used as follows: + + -- 256 is reserved for the VxWorks kernel + -- 248 - 255 correspond to hardware interrupt levels 0 .. 7 + -- 247 is a catchall default "interrupt" priority for signals, + -- allowing higher priority than normal tasks, but lower than + -- hardware priority levels. Protected Object ceilings can + -- override these values. + -- 246 is used by the Interrupt_Manager task + + Max_Priority : constant Positive := 245; + Max_Interrupt_Priority : constant Positive := 255; + + subtype Any_Priority is Integer range 0 .. 255; + subtype Priority is Any_Priority range 0 .. 245; + subtype Interrupt_Priority is Any_Priority range 246 .. 255; + + Default_Priority : constant Priority := 122; + +private + + pragma Linker_Options ("--specs=vxworks-gnat-crtbe-link.spec"); + -- Pull in crtbegin/crtend objects and register exceptions for ZCX. + -- This is commented out by our Makefile for SJLJ runtimes. + + pragma Linker_Options ("--specs=vxworks7-rtp-base-link.spec"); + -- Define the symbol wrs_rtp_base + + type Address is mod Memory_Size; + Null_Address : constant Address := 0; + + -------------------------------------- + -- System Implementation Parameters -- + -------------------------------------- + + -- These parameters provide information about the target that is used + -- by the compiler. They are in the private part of System, where they + -- can be accessed using the special circuitry in the Targparm unit + -- whose source should be consulted for more detailed descriptions + -- of the individual switch values. + + Backend_Divide_Checks : constant Boolean := False; + Backend_Overflow_Checks : constant Boolean := True; + Command_Line_Args : constant Boolean := True; + Configurable_Run_Time : constant Boolean := False; + Denorm : constant Boolean := True; + Duration_32_Bits : constant Boolean := False; + Exit_Status_Supported : constant Boolean := True; + Fractional_Fixed_Ops : constant Boolean := False; + Frontend_Layout : constant Boolean := False; + Machine_Overflows : constant Boolean := False; + Machine_Rounds : constant Boolean := True; + Preallocated_Stacks : constant Boolean := False; + Signed_Zeros : constant Boolean := True; + Stack_Check_Default : constant Boolean := False; + Stack_Check_Probes : constant Boolean := True; + Stack_Check_Limits : constant Boolean := False; + Support_Aggregates : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; + Always_Compatible_Rep : constant Boolean := False; + Suppress_Standard_Library : constant Boolean := False; + Use_Ada_Main_Program_Name : constant Boolean := False; + Frontend_Exceptions : constant Boolean := False; + ZCX_By_Default : constant Boolean := True; + + Executable_Extension : constant String := ".vxe"; + +end System; diff --git a/gcc/ada/libgnat/system-vxworks7-aarch64.ads b/gcc/ada/libgnat/system-vxworks7-aarch64.ads new file mode 100644 index 00000000000..6e985b36cee --- /dev/null +++ b/gcc/ada/libgnat/system-vxworks7-aarch64.ads @@ -0,0 +1,168 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M -- +-- -- +-- S p e c -- +-- (VxWorks 7.x AARCH64 Kernel) -- +-- -- +-- Copyright (C) 1992-2017, Free Software Foundation, Inc. -- +-- -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. The copyright notice above, and the license provisions that follow -- +-- apply solely to the contents of the part following the private keyword. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This is the VxWorks 7.x version of this package for AARCH64 Kernel + +package System is + pragma Pure; + -- Note that we take advantage of the implementation permission to make + -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada + -- 2005, this is Pure in any case (AI-362). + + pragma No_Elaboration_Code_All; + -- Allow the use of that restriction in units that WITH this unit + + type Name is (SYSTEM_NAME_GNAT); + System_Name : constant Name := SYSTEM_NAME_GNAT; + + -- System-Dependent Named Numbers + + Min_Int : constant := Long_Long_Integer'First; + Max_Int : constant := Long_Long_Integer'Last; + + Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; + Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; + + Max_Base_Digits : constant := Long_Long_Float'Digits; + Max_Digits : constant := Long_Long_Float'Digits; + + Max_Mantissa : constant := 63; + Fine_Delta : constant := 2.0 ** (-Max_Mantissa); + + Tick : constant := 1.0 / 60.0; + + -- Storage-related Declarations + + type Address is private; + pragma Preelaborable_Initialization (Address); + Null_Address : constant Address; + + Storage_Unit : constant := 8; + Word_Size : constant := 64; + Memory_Size : constant := 2 ** 64; + + -- Address comparison + + function "<" (Left, Right : Address) return Boolean; + function "<=" (Left, Right : Address) return Boolean; + function ">" (Left, Right : Address) return Boolean; + function ">=" (Left, Right : Address) return Boolean; + function "=" (Left, Right : Address) return Boolean; + + pragma Import (Intrinsic, "<"); + pragma Import (Intrinsic, "<="); + pragma Import (Intrinsic, ">"); + pragma Import (Intrinsic, ">="); + pragma Import (Intrinsic, "="); + + -- Other System-Dependent Declarations + + type Bit_Order is (High_Order_First, Low_Order_First); + Default_Bit_Order : constant Bit_Order := Low_Order_First; + pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning + + -- Priority-related Declarations (RM D.1) + + -- Ada priorities are mapped to VxWorks priorities using the following + -- transformation: 255 - Ada Priority + + -- Ada priorities are used as follows: + + -- 256 is reserved for the VxWorks kernel + -- 248 - 255 correspond to hardware interrupt levels 0 .. 7 + -- 247 is a catchall default "interrupt" priority for signals, + -- allowing higher priority than normal tasks, but lower than + -- hardware priority levels. Protected Object ceilings can + -- override these values. + -- 246 is used by the Interrupt_Manager task + + Max_Priority : constant Positive := 245; + Max_Interrupt_Priority : constant Positive := 255; + + subtype Any_Priority is Integer range 0 .. 255; + subtype Priority is Any_Priority range 0 .. 245; + subtype Interrupt_Priority is Any_Priority range 246 .. 255; + + Default_Priority : constant Priority := 122; + +private + + pragma Linker_Options ("--specs=vxworks-gnat-crtbe-link.spec"); + -- Pull in crtbegin/crtend objects and register exceptions for ZCX. + -- This is commented out by our Makefile for SJLJ runtimes. + + type Address is mod Memory_Size; + Null_Address : constant Address := 0; + + -------------------------------------- + -- System Implementation Parameters -- + -------------------------------------- + + -- These parameters provide information about the target that is used + -- by the compiler. They are in the private part of System, where they + -- can be accessed using the special circuitry in the Targparm unit + -- whose source should be consulted for more detailed descriptions + -- of the individual switch values. + + Backend_Divide_Checks : constant Boolean := False; + Backend_Overflow_Checks : constant Boolean := True; + Command_Line_Args : constant Boolean := False; + Configurable_Run_Time : constant Boolean := False; + Denorm : constant Boolean := True; + Duration_32_Bits : constant Boolean := False; + Exit_Status_Supported : constant Boolean := True; + Fractional_Fixed_Ops : constant Boolean := False; + Frontend_Layout : constant Boolean := False; + Machine_Overflows : constant Boolean := False; + Machine_Rounds : constant Boolean := True; + Preallocated_Stacks : constant Boolean := False; + Signed_Zeros : constant Boolean := True; + Stack_Check_Default : constant Boolean := False; + Stack_Check_Probes : constant Boolean := True; + Stack_Check_Limits : constant Boolean := False; + Support_Aggregates : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; + Always_Compatible_Rep : constant Boolean := False; + Suppress_Standard_Library : constant Boolean := False; + Use_Ada_Main_Program_Name : constant Boolean := True; + Frontend_Exceptions : constant Boolean := False; + ZCX_By_Default : constant Boolean := True; + + Executable_Extension : constant String := ".out"; + +end System; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 729e717f4ad..045b8580c8d 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -2533,16 +2533,11 @@ package body Sem_Ch8 is Typ : Entity_Id; begin - -- Nothing to do when the subprogram appears within an instance - - if In_Instance then - return; - -- Nothing to do when the subprogram is not subject to SPARK_Mode On -- because this check applies to SPARK code only. - elsif not (Present (Prag) - and then Get_SPARK_Mode_From_Annotation (Prag) = On) + if not (Present (Prag) + and then Get_SPARK_Mode_From_Annotation (Prag) = On) then return; diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index b66eae4e77d..1f854945bd4 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -4242,7 +4242,7 @@ package body Sem_Elab is -- Determine whether list List contains at least one suitable construct -- for inclusion into an early call region. - procedure Include (N : Node_Id; Curr : in out Node_Id); + procedure Include (N : Node_Id; Curr : out Node_Id); pragma Inline (Include); -- Update the Curr and Start pointers to include arbitrary construct N -- in the early call region. This routine raises ECR_Found. @@ -4556,7 +4556,7 @@ package body Sem_Elab is -- Include -- ------------- - procedure Include (N : Node_Id; Curr : in out Node_Id) is + procedure Include (N : Node_Id; Curr : out Node_Id) is begin Start := N; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 056703cb1b5..136505f23d5 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -12890,8 +12890,9 @@ package body Sem_Util is E_Package, E_Procedure, E_Protected_Type, - E_Task_Type)); - + E_Task_Type) + or else + Is_Record_Type (Context_Id)); return Scope_Within_Or_Same (Context_Id, Ref_Id); end if; end Is_CCT_Instance; diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 76fc6af266a..a12b2608503 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -1536,9 +1536,10 @@ package Sem_Util is (Ref_Id : Entity_Id; Context_Id : Entity_Id) return Boolean; -- Subsidiary to the analysis of pragmas [Refined_]Depends and [Refined_] - -- Global. Determine whether entity Ref_Id (which must represent either - -- a protected type or a task type) denotes the current instance of a - -- concurrent type. Context_Id denotes the associated context where the + -- Global; also used when analyzing default expressions of protected and + -- record components. Determine whether entity Ref_Id (which must represent + -- either a protected type or a task type) denotes the current instance of + -- a concurrent type. Context_Id denotes the associated context where the -- pragma appears. function Is_Child_Or_Sibling diff --git a/gcc/ada/sigtramp-vxworks-target.inc b/gcc/ada/sigtramp-vxworks-target.inc index 3db6782bdc6..a49a48f8bb3 100644 --- a/gcc/ada/sigtramp-vxworks-target.inc +++ b/gcc/ada/sigtramp-vxworks-target.inc @@ -6,7 +6,7 @@ * * * Asm Implementation Include File * * * - * Copyright (C) 2011-2015, Free Software Foundation, Inc. * + * Copyright (C) 2011-2017, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -93,13 +93,26 @@ #define FUNCTION "@function" -#elif defined (__ARMEL__) +#elif defined (ARMEL) #define REGNO_G_REG_OFFSET(N) (N) +#define FUNCTION "%function" + +#ifdef __aarch64__ +#define REGNO_PC_OFFSET 31 /* PC_REGNUM */ +#else #define REGNO_PC_OFFSET 15 /* PC_REGNUM */ +#endif -#define FUNCTION "%function" +/* Mapping of CFI Column, Gcc Regno, Signal context offset for _LP64 + + Name CFI GCC SCTX + G0-G30 0-30 0-30 + PC 31 31 + V0-V31 64-95 32-63 + +*/ #elif defined (i386) @@ -190,11 +203,14 @@ Not_implemented; #define CFA_REG 15 -#elif defined (__ARMEL__) +#elif defined (ARMEL) +#ifdef __aarch64__ +#define CFA_REG 19 +#else /* Use r8 for ARM. Any of r4-r8 should work. */ - #define CFA_REG 8 +#endif #elif defined (i386) @@ -332,11 +348,12 @@ TCR("mtlr %r0") \ TCR("blr") #endif -#elif defined (__ARMEL__) +#elif defined (ARMEL) #define COMMON_CFI(REG) \ ".cfi_offset " S(REGNO_##REG) "," S(REG_SET_##REG) +#ifdef __aarch64__ #define CFI_COMMON_REGS \ CR("# CFI for common registers\n") \ TCR(COMMON_CFI(G_REG_OFFSET(0))) \ @@ -354,12 +371,63 @@ TCR(COMMON_CFI(G_REG_OFFSET(11))) \ TCR(COMMON_CFI(G_REG_OFFSET(12))) \ TCR(COMMON_CFI(G_REG_OFFSET(13))) \ TCR(COMMON_CFI(G_REG_OFFSET(14))) \ +TCR(COMMON_CFI(G_REG_OFFSET(15))) \ +TCR(COMMON_CFI(G_REG_OFFSET(16))) \ +TCR(COMMON_CFI(G_REG_OFFSET(17))) \ +TCR(COMMON_CFI(G_REG_OFFSET(18))) \ +TCR(COMMON_CFI(G_REG_OFFSET(19))) \ +TCR(COMMON_CFI(G_REG_OFFSET(20))) \ +TCR(COMMON_CFI(G_REG_OFFSET(21))) \ +TCR(COMMON_CFI(G_REG_OFFSET(22))) \ +TCR(COMMON_CFI(G_REG_OFFSET(23))) \ +TCR(COMMON_CFI(G_REG_OFFSET(24))) \ +TCR(COMMON_CFI(G_REG_OFFSET(25))) \ +TCR(COMMON_CFI(G_REG_OFFSET(26))) \ +TCR(COMMON_CFI(G_REG_OFFSET(27))) \ +TCR(COMMON_CFI(G_REG_OFFSET(28))) \ +TCR(COMMON_CFI(G_REG_OFFSET(29))) \ TCR(COMMON_CFI(PC_OFFSET)) \ TCR(".cfi_return_column " S(REGNO_PC_OFFSET)) +#else +#define CFI_COMMON_REGS \ +CR("# CFI for common registers\n") \ +TCR(COMMON_CFI(G_REG_OFFSET(0))) \ +TCR(COMMON_CFI(G_REG_OFFSET(1))) \ +TCR(COMMON_CFI(G_REG_OFFSET(2))) \ +TCR(COMMON_CFI(G_REG_OFFSET(3))) \ +TCR(COMMON_CFI(G_REG_OFFSET(4))) \ +TCR(COMMON_CFI(G_REG_OFFSET(5))) \ +TCR(COMMON_CFI(G_REG_OFFSET(6))) \ +TCR(COMMON_CFI(G_REG_OFFSET(7))) \ +TCR(COMMON_CFI(G_REG_OFFSET(8))) \ +TCR(COMMON_CFI(G_REG_OFFSET(9))) \ +TCR(COMMON_CFI(G_REG_OFFSET(10))) \ +TCR(COMMON_CFI(G_REG_OFFSET(11))) \ +TCR(COMMON_CFI(G_REG_OFFSET(12))) \ +TCR(COMMON_CFI(G_REG_OFFSET(13))) \ +TCR(COMMON_CFI(G_REG_OFFSET(14))) \ +TCR(COMMON_CFI(PC_OFFSET)) \ +TCR(".cfi_return_column " S(REGNO_PC_OFFSET)) +#endif /* Trampoline body block --------------------- */ - +#ifdef __aarch64__ +#define SIGTRAMP_BODY \ +CR("") \ +TCR("# Push FP and LR on stack") \ +TCR("stp x29, x30, [sp, #-16]!") \ +TCR("# Push register used to hold the CFA on stack") \ +TCR("str x" S(CFA_REG) ", [sp, #-8]!") \ +TCR("# Set the CFA: x2 value") \ +TCR("mov x" S(CFA_REG) ", x2") \ +TCR("# Call the handler") \ +TCR("blr x3") \ +TCR("# Release our frame and return (should never get here!).") \ +TCR("ldr x" S(CFA_REG) " , [sp], 8") \ +TCR("ldp x29, x30, [sp], 16") \ +TCR("ret") +#else #define SIGTRAMP_BODY \ CR("") \ TCR("# Allocate frame and save the non-volatile") \ @@ -375,6 +443,7 @@ TCR("sub fp, ip, #4") \ TCR("blx r3") \ TCR("# Restore our callee-saved items, release our frame and return") \ TCR("ldmfd sp, {r"S(CFA_REG)", fp, sp, pc}") +#endif #elif defined (i386) diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c index e5eb0fefc26..3c43d1a5569 100644 --- a/gcc/ada/tracebak.c +++ b/gcc/ada/tracebak.c @@ -309,7 +309,7 @@ __gnat_backtrace (void **array, #define USE_GCC_UNWINDER #define PC_ADJUST -2 -#if (_WRS_VXWORKS_MAJOR >= 7) +#if ((_WRS_VXWORKS_MAJOR >= 7) && (_VX_CPU != ARMARCH8A)) #define USING_ARM_UNWINDING 1 #endif