aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-10-13 16:43:56 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-10-13 16:43:56 -0700
commitd8cb061445ce6177ca92c92efa72ed4b736e6143 (patch)
tree6eb864280d18e81e41ea44c20c6751fdf9ea6978 /gcc
parentbf6ac87cc8d6a0c39c88dc78b2263317a6284c00 (diff)
downloadgcc-d8cb061445ce6177ca92c92efa72ed4b736e6143.zip
gcc-d8cb061445ce6177ca92c92efa72ed4b736e6143.tar.gz
gcc-d8cb061445ce6177ca92c92efa72ed4b736e6143.tar.bz2
re PR debug/15860 (No DW_AT_location debug info is emitted for formal arguments to a function that uses "register" qualifiers)
PR debug/15860 * dwarf2out.c (rtl_for_decl_location): Apply big-endian correction for DECL_INCOMING_RTL. From-SVN: r89012
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2out.c29
2 files changed, 27 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 036c72f..cea88e1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-13 Richard Henderson <rth@redhat.com>
+
+ PR debug/15860
+ * dwarf2out.c (rtl_for_decl_location): Apply big-endian correction
+ for DECL_INCOMING_RTL.
+
2004-10-14 Hans-Peter Nilsson <hp@axis.com>
PR target/17984
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 500ab40..75e328d 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -9790,19 +9790,32 @@ rtl_for_decl_location (tree decl)
{
if (rtl == NULL_RTX || is_pseudo_reg (rtl))
{
- tree declared_type = type_main_variant (TREE_TYPE (decl));
- tree passed_type = type_main_variant (DECL_ARG_TYPE (decl));
+ tree declared_type = TREE_TYPE (decl);
+ tree passed_type = DECL_ARG_TYPE (decl);
+ enum machine_mode dmode = TYPE_MODE (declared_type);
+ enum machine_mode pmode = TYPE_MODE (passed_type);
/* This decl represents a formal parameter which was optimized out.
Note that DECL_INCOMING_RTL may be NULL in here, but we handle
all cases where (rtl == NULL_RTX) just below. */
- if (declared_type == passed_type)
- rtl = DECL_INCOMING_RTL (decl);
- else if (! BYTES_BIG_ENDIAN
- && TREE_CODE (declared_type) == INTEGER_TYPE
- && (GET_MODE_SIZE (TYPE_MODE (declared_type))
- <= GET_MODE_SIZE (TYPE_MODE (passed_type))))
+ if (dmode == pmode)
rtl = DECL_INCOMING_RTL (decl);
+ else if (SCALAR_INT_MODE_P (dmode)
+ && GET_MODE_SIZE (dmode) <= GET_MODE_SIZE (pmode))
+ {
+ rtx inc = DECL_INCOMING_RTL (decl);
+ if (REG_P (inc))
+ rtl = inc;
+ else if (MEM_P (inc))
+ {
+ if (BYTES_BIG_ENDIAN)
+ rtl = adjust_address_nv (inc, dmode,
+ GET_MODE_SIZE (pmode)
+ - GET_MODE_SIZE (dmode));
+ else
+ rtl = inc;
+ }
+ }
}
/* If the parm was passed in registers, but lives on the stack, then