From 1f5afe1cc03bb2cd50b75a21d491a349d7011ea1 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 17 Mar 2014 16:30:30 +0000 Subject: [PATCH] Add support for parsing VFP register names in .cfi_offset directives. PR gas/16694 * config/tc-arm.c (tc_arm_regname_to_dw2regnum): Parse VFP registers as well. * gas/cfi/cfi-arm-1.s: Add checks of VFP registers. * gas/cfi/cfi-arm-1.d: Update expected output. --- gas/ChangeLog | 6 ++++++ gas/config/tc-arm.c | 29 +++++++++++++++++++++++------ gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/cfi/cfi-arm-1.d | 9 +++++++-- gas/testsuite/gas/cfi/cfi-arm-1.s | 6 ++++++ 5 files changed, 48 insertions(+), 8 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index d3d92acc618..1d27b7e97a6 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2014-03-17 Nick Clifton + + PR gas/16694 + * config/tc-arm.c (tc_arm_regname_to_dw2regnum): Parse VFP + registers as well. + 2014-03-13 Richard Earnshaw Jiong Wang diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index b3c974bbe52..bdcfb5c0d95 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -4134,15 +4134,24 @@ s_arm_unwind_save (int arch_v6) s_arm_unwind_save_fpa (reg->number); return; - case REG_TYPE_RN: s_arm_unwind_save_core (); return; + case REG_TYPE_RN: + s_arm_unwind_save_core (); + return; + case REG_TYPE_VFD: if (arch_v6) s_arm_unwind_save_vfp_armv6 (); else s_arm_unwind_save_vfp (); return; - case REG_TYPE_MMXWR: s_arm_unwind_save_mmxwr (); return; - case REG_TYPE_MMXWCG: s_arm_unwind_save_mmxwcg (); return; + + case REG_TYPE_MMXWR: + s_arm_unwind_save_mmxwr (); + return; + + case REG_TYPE_MMXWCG: + s_arm_unwind_save_mmxwcg (); + return; default: as_bad (_(".unwind_save does not support this kind of register")); @@ -21019,11 +21028,19 @@ int tc_arm_regname_to_dw2regnum (char *regname) { int reg = arm_reg_parse (®name, REG_TYPE_RN); + if (reg != FAIL) + return reg; - if (reg == FAIL) - return -1; + /* PR 16694: Allow VFP registers as well. */ + reg = arm_reg_parse (®name, REG_TYPE_VFS); + if (reg != FAIL) + return 64 + reg; - return reg; + reg = arm_reg_parse (®name, REG_TYPE_VFD); + if (reg != FAIL) + return reg + 256; + + return -1; } #ifdef TE_PE diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 293628b32de..4863e614fbe 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-03-17 Nick Clifton + + PR gas/16694 + * gas/cfi/cfi-arm-1.s: Add checks of VFP registers. + * gas/cfi/cfi-arm-1.d: Update expected output. + 2014-03-13 Nick Clifton * gas/aarch64/litpool.s: Make the test endian agnostic. diff --git a/gas/testsuite/gas/cfi/cfi-arm-1.d b/gas/testsuite/gas/cfi/cfi-arm-1.d index 8987a7c8b69..0d831e0042a 100644 --- a/gas/testsuite/gas/cfi/cfi-arm-1.d +++ b/gas/testsuite/gas/cfi/cfi-arm-1.d @@ -13,7 +13,7 @@ Contents of the .eh_frame section: DW_CFA_def_cfa: r13 ofs 0 -00000014 0+0020 0+0018 FDE cie=0+0000 pc=0+0000..0+0018 +00000014 0+002c 0+0018 FDE cie=0+0000 pc=0+0000..0+0018 DW_CFA_advance_loc: 4 to 00000004 DW_CFA_def_cfa: r12 ofs 0 DW_CFA_advance_loc: 4 to 00000008 @@ -24,4 +24,9 @@ Contents of the .eh_frame section: DW_CFA_offset: r14 at cfa-24 DW_CFA_advance_loc: 4 to 00000010 DW_CFA_def_cfa: r11 ofs 16 - + DW_CFA_advance_loc: 4 to 00000014 + DW_CFA_offset: r1 at cfa-16 + DW_CFA_offset_extended: r65 at cfa-20 + DW_CFA_offset_extended: r267 at cfa-48 + DW_CFA_nop + DW_CFA_nop diff --git a/gas/testsuite/gas/cfi/cfi-arm-1.s b/gas/testsuite/gas/cfi/cfi-arm-1.s index 8c9d9176bf5..d9624420d26 100644 --- a/gas/testsuite/gas/cfi/cfi-arm-1.s +++ b/gas/testsuite/gas/cfi/cfi-arm-1.s @@ -18,6 +18,12 @@ foo: sub fp, ip, #20 .cfi_def_cfa fp, 16 nop + + # Test fix for PR 16694 - the use of VFP registers in .cfi_offset directives. + .cfi_offset r1, -16 + .cfi_offset s1, -20 + .cfi_offset d11, -48 + ldmea fp, {fp, sp, pc} .cfi_endproc .size foo, .-foo -- 2.30.2