diff options
| author | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-04-21 00:24:05 +0000 |
|---|---|---|
| committer | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-04-21 00:24:05 +0000 |
| commit | 13906b028db0d396dcfbee7f9c98df27b064decd (patch) | |
| tree | d1f75e32e70eb5b6db5f1b876cf585a131e1711f | |
| parent | a6b8b2af805c336426a8200b34a211676d8d9ee1 (diff) | |
| download | ppe42-gcc-13906b028db0d396dcfbee7f9c98df27b064decd.tar.gz ppe42-gcc-13906b028db0d396dcfbee7f9c98df27b064decd.zip | |
* dwarf2out.c (rtl_for_decl_location): Adjust rtl for byte
variables stored in word registers, then in memory.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80941 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/dwarf2out.c | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 58436c33b0e..3c7c4997e15 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-04-20 DJ Delorie <dj@redhat.com> + + * dwarf2out.c (rtl_for_decl_location): Adjust rtl for byte + variables stored in word registers, then in memory. + 2004-04-20 Eric Christopher <echristo@redhat.com> * cp/parser.c (cp_parser_declaration): Move translate diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 86512a4f8f5..9cd05a0a644 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9756,6 +9756,24 @@ rtl_for_decl_location (tree decl) plus_constant (XEXP (rtl, 0), offset)); } } + else if (TREE_CODE (decl) == VAR_DECL + && GET_CODE (rtl) == MEM + && GET_MODE (rtl) != TYPE_MODE (TREE_TYPE (decl)) + && BYTES_BIG_ENDIAN) + { + int rsize = GET_MODE_SIZE (GET_MODE (rtl)); + int dsize = GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (decl))); + + /* If a variable is declared "register" yet is smaller than + a register, then if we store the variable to memory, it + looks like we're storing a register-sized value, when in + fact we are not. We need to adjust the offset of the + storage location to reflect the actual value's bytes, + else gdb will not be able to display it. */ + if (rsize > dsize) + rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (decl)), + plus_constant (XEXP (rtl, 0), rsize-dsize)); + } if (rtl != NULL_RTX) { |

