diff options
author | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-24 17:48:42 +0000 |
---|---|---|
committer | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-24 17:48:42 +0000 |
commit | 80291b9e9e7874b2e1f85e3d98ede07b4b24ceaa (patch) | |
tree | 46d6959f35e3370804815de6e46fac7749e856c0 /gcc/dwarf2out.c | |
parent | cc45e5e8999a2cfa74e120e157b6b19955b8da2a (diff) | |
download | ppe42-gcc-80291b9e9e7874b2e1f85e3d98ede07b4b24ceaa.tar.gz ppe42-gcc-80291b9e9e7874b2e1f85e3d98ede07b4b24ceaa.zip |
Fix dwarf2 debug error found by gdb testsuite: add big-endian correction.
* dwarf2out.c (add_location_or_const_value_attribute): Add big
endian correction for parms passed in regs but living on the stack.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25412 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c8d27b0cd27..48331b9e789 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -7084,6 +7084,38 @@ add_location_or_const_value_attribute (die, decl) && TYPE_SIZE (declared_type) <= TYPE_SIZE (passed_type)) rtl = DECL_INCOMING_RTL (decl); } + + /* If the parm was passed in registers, but lives on the stack, then + make a big endian correction if the mode of the type of the + parameter is not the same as the mode of the rtl. */ + /* ??? This is the same series of checks that are made in dbxout.c before + we reach the big endian correction code there. It isn't clear if all + of these checks are necessary here, but keeping them all is the safe + thing to do. */ + else if (GET_CODE (rtl) == MEM + && XEXP (rtl, 0) != const0_rtx + && ! CONSTANT_P (XEXP (rtl, 0)) + /* Not passed in memory. */ + && GET_CODE (DECL_INCOMING_RTL (decl)) != MEM + /* Not passed by invisible reference. */ + && (GET_CODE (XEXP (rtl, 0)) != REG + || REGNO (XEXP (rtl, 0)) == HARD_FRAME_POINTER_REGNUM + || REGNO (XEXP (rtl, 0)) == STACK_POINTER_REGNUM +#if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM + || REGNO (XEXP (rtl, 0)) == ARG_POINTER_REGNUM +#endif + ) + /* Big endian correction check. */ + && BYTES_BIG_ENDIAN + && TYPE_MODE (TREE_TYPE (decl)) != GET_MODE (rtl) + && (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (decl))) + < UNITS_PER_WORD)) + { + int offset = (UNITS_PER_WORD + - GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (decl)))); + rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (decl)), + plus_constant (XEXP (rtl, 0), offset)); + } } if (rtl == NULL_RTX) |