diff options
author | Florian Weimer <fweimer@redhat.com> | 2023-01-02 16:18:02 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2023-01-02 16:18:02 +0100 |
commit | 3b6cac2b44b384cd2091eaeaebeb3478c253a25d (patch) | |
tree | 0c7eaab6bb102eca8829b40fef1e9d531f10eb7d /gcc/config | |
parent | 8385088039f58a1d403cbb0792105236d240de85 (diff) | |
download | gcc-3b6cac2b44b384cd2091eaeaebeb3478c253a25d.zip gcc-3b6cac2b44b384cd2091eaeaebeb3478c253a25d.tar.gz gcc-3b6cac2b44b384cd2091eaeaebeb3478c253a25d.tar.bz2 |
Compute a table of DWARF register sizes at compile
The sizes are compile-time constants. Create a vector with them,
so that they can be inspected at compile time.
gcc/
* dwarf2cfi.cc (init_return_column_size): Remove.
(init_one_dwarf_reg_size): Adjust.
(generate_dwarf_reg_sizes): New function. Extracted
from expand_builtin_init_dwarf_reg_sizes.
(expand_builtin_init_dwarf_reg_sizes): Call
generate_dwarf_reg_sizes.
* target.def (init_dwarf_reg_sizes_extra): Adjust
hook signature.
* config/msp430/msp430.cc
(msp430_init_dwarf_reg_sizes_extra): Adjust.
* config/rs6000/rs6000.cc
(rs6000_init_dwarf_reg_sizes_extra): Likewise.
* doc/tm.texi: Update.
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/msp430/msp430.cc | 11 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.cc | 14 |
2 files changed, 4 insertions, 21 deletions
diff --git a/gcc/config/msp430/msp430.cc b/gcc/config/msp430/msp430.cc index 6c15780..dbea8d7 100644 --- a/gcc/config/msp430/msp430.cc +++ b/gcc/config/msp430/msp430.cc @@ -3202,11 +3202,9 @@ msp430_expand_eh_return (rtx eh_handler) #undef TARGET_INIT_DWARF_REG_SIZES_EXTRA #define TARGET_INIT_DWARF_REG_SIZES_EXTRA msp430_init_dwarf_reg_sizes_extra void -msp430_init_dwarf_reg_sizes_extra (tree address) +msp430_init_dwarf_reg_sizes_extra (poly_uint16 *sizes) { int i; - rtx addr = expand_normal (address); - rtx mem = gen_rtx_MEM (BLKmode, addr); /* This needs to match msp430_unwind_word_mode (above). */ if (!msp430x) @@ -3218,12 +3216,7 @@ msp430_init_dwarf_reg_sizes_extra (tree address) unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1); if (rnum < DWARF_FRAME_REGISTERS) - { - HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (QImode); - - emit_move_insn (adjust_address (mem, QImode, offset), - gen_int_mode (4, QImode)); - } + sizes[rnum] = 4; } } diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 6ac3adc..875684a 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -23860,27 +23860,17 @@ rs6000_initial_elimination_offset (int from, int to) /* Fill in sizes of registers used by unwinder. */ static void -rs6000_init_dwarf_reg_sizes_extra (tree address) +rs6000_init_dwarf_reg_sizes_extra (poly_uint16 *sizes) { if (TARGET_MACHO && ! TARGET_ALTIVEC) { int i; - machine_mode mode = TYPE_MODE (char_type_node); - rtx addr = expand_expr (address, NULL_RTX, VOIDmode, EXPAND_NORMAL); - rtx mem = gen_rtx_MEM (BLKmode, addr); - rtx value = gen_int_mode (16, mode); /* On Darwin, libgcc may be built to run on both G3 and G4/5. The unwinder still needs to know the size of Altivec registers. */ for (i = FIRST_ALTIVEC_REGNO; i < LAST_ALTIVEC_REGNO+1; i++) - { - int column = DWARF_REG_TO_UNWIND_COLUMN - (DWARF2_FRAME_REG_OUT (DWARF_FRAME_REGNUM (i), true)); - HOST_WIDE_INT offset = column * GET_MODE_SIZE (mode); - - emit_move_insn (adjust_address (mem, mode, offset), value); - } + sizes[i] = 16; } } |