Commit d8cb0614 by Richard Henderson Committed by Richard Henderson

re PR debug/15860 (No DW_AT_location debug info is emitted for formal arguments…

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
parent bf6ac87c
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> 2004-10-14 Hans-Peter Nilsson <hp@axis.com>
PR target/17984 PR target/17984
......
...@@ -9790,19 +9790,32 @@ rtl_for_decl_location (tree decl) ...@@ -9790,19 +9790,32 @@ rtl_for_decl_location (tree decl)
{ {
if (rtl == NULL_RTX || is_pseudo_reg (rtl)) if (rtl == NULL_RTX || is_pseudo_reg (rtl))
{ {
tree declared_type = type_main_variant (TREE_TYPE (decl)); tree declared_type = TREE_TYPE (decl);
tree passed_type = type_main_variant (DECL_ARG_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. /* This decl represents a formal parameter which was optimized out.
Note that DECL_INCOMING_RTL may be NULL in here, but we handle Note that DECL_INCOMING_RTL may be NULL in here, but we handle
all cases where (rtl == NULL_RTX) just below. */ all cases where (rtl == NULL_RTX) just below. */
if (declared_type == passed_type) if (dmode == pmode)
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))))
rtl = DECL_INCOMING_RTL (decl); 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 /* If the parm was passed in registers, but lives on the stack, then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment