Commit 6eb065e6 by Sterling Augustine Committed by Bob Wilson

unwind-dw2-xtensa.c: New.

	* config/xtensa/unwind-dw2-xtensa.c: New.
	* config/xtensa/unwind-dw2-xtensa.h: New.
	* config/xtensa/xtensa.h (MUST_USE_SJLJ_EXCEPTIONS): Remove.
	(DWARF2_UNWIND_INFO): Remove.
	(DWARF_FRAME_REGISTERS): Define.
	(EH_RETURN_DATA_REGNO): Define.
	* config/xtensa/xtensa.md (UNSPECV_EH_RETURN): Define.
	(eh_return): New.
	* config/xtensa/t-xtensa (LIB2ADDEH): Define.

Co-Authored-By: Bob Wilson <bob.wilson@acm.org>

From-SVN: r130160
parent b423089e
2007-11-13 Sterling Augustine <sterling@tensilica.com>
Bob Wilson <bob.wilson@acm.org>
* config/xtensa/unwind-dw2-xtensa.c: New.
* config/xtensa/unwind-dw2-xtensa.h: New.
* config/xtensa/xtensa.h (MUST_USE_SJLJ_EXCEPTIONS): Remove.
(DWARF2_UNWIND_INFO): Remove.
(DWARF_FRAME_REGISTERS): Define.
(EH_RETURN_DATA_REGNO): Define.
* config/xtensa/xtensa.md (UNSPECV_EH_RETURN): Define.
(eh_return): New.
* config/xtensa/t-xtensa (LIB2ADDEH): Define.
2007-11-13 Jakub Jelinek <jakub@redhat.com>
* doc/invoke.texi: Fix description of -fsched-stalled-insns=0,
......@@ -11,6 +11,8 @@ LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 _udivsi3 _umodsi3 \
_truncdfsf2 _extendsfdf2
LIB2FUNCS_EXTRA = $(srcdir)/config/xtensa/lib2funcs.S
LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
$(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
$(T)crti.o: $(srcdir)/config/xtensa/crti.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
......
/* DWARF2 frame unwind data structure for Xtensa.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2007
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combined
executable.)
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
/* A target can override (perhaps for backward compatibility) how
many dwarf2 columns are unwound. */
#ifndef DWARF_FRAME_REGISTERS
#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
#endif
/* Xtensa's variable-size register window save areas can be unwound without
any unwind info. This is a stripped down version of the standard DWARF
_Unwind_FrameState. */
typedef struct
{
/* The PC described by the current frame state. */
void *pc;
/* The information we care about from the CIE/FDE. */
_Unwind_Personality_Fn personality;
_Unwind_Word retaddr_column;
unsigned char fde_encoding;
unsigned char lsda_encoding;
unsigned char saw_z;
unsigned char signal_frame;
void *eh_ptr;
/* Saved registers for a signal frame. */
_Unwind_Word *signal_regs;
} _Unwind_FrameState;
......@@ -1062,12 +1062,15 @@ typedef struct xtensa_args
/* How to start an assembler comment. */
#define ASM_COMMENT_START "#"
/* Generate DWARF2 unwind info to get the DW_AT_frame_base set correctly,
even though we don't yet use it for unwinding. */
#define MUST_USE_SJLJ_EXCEPTIONS 1
#define DWARF2_UNWIND_INFO 1
/* Exception handling. Xtensa uses much of the standard DWARF2 unwinding
machinery, but the variable size register window save areas are too
complicated to efficiently describe with CFI entries. The CFA must
still be specified in DWARF so that DW_AT_frame_base is set correctly
for debugging. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 0)
#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (0)
#define DWARF_FRAME_REGISTERS 16
#define EH_RETURN_DATA_REGNO(N) ((N) < 2 ? (N) + 2 : INVALID_REGNUM)
/* Xtensa constant pool breaks the devices in crtstuff.c to control
section in where code resides. We have to write it as asm code. Use
......
......@@ -35,6 +35,7 @@
(UNSPECV_MEMW 3)
(UNSPECV_S32RI 4)
(UNSPECV_S32C1I 5)
(UNSPECV_EH_RETURN 6)
])
;; This code iterator allows signed and unsigned widening multiplications
......@@ -1600,6 +1601,26 @@
DONE;
})
;; Stuff an address into the return address register along with the window
;; size in the high bits. Because we don't have the window size of the
;; previous frame, assume the function called out with a CALL8 since that
;; is what compilers always use. Note: __builtin_frob_return_addr has
;; already been applied to the handler, but the generic version doesn't
;; allow us to frob it quite enough, so we just frob here.
(define_insn_and_split "eh_return"
[(set (reg:SI A0_REG)
(unspec_volatile:SI [(match_operand:SI 0 "register_operand" "r")]
UNSPECV_EH_RETURN))
(clobber (match_scratch:SI 1 "=r"))]
""
"#"
"reload_completed"
[(set (match_dup 1) (ashift:SI (match_dup 0) (const_int 2)))
(set (match_dup 1) (plus:SI (match_dup 1) (const_int 2)))
(set (reg:SI A0_REG) (rotatert:SI (match_dup 1) (const_int 2)))]
"")
;; Setting up a frame pointer is tricky for Xtensa because GCC doesn't
;; know if a frame pointer is required until the reload pass, and
;; because there may be an incoming argument value in the hard frame
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment