cfa_temp.offset = <const_int>
Rule 10:
- (set (mem (pre_modify sp:cfa_store (???? <reg1> <const_int>))) <reg2>)
+ (set (mem ({pre,post}_modify sp:cfa_store (???? <reg1> <const_int>))) <reg2>)
effects: cfa_store.offset -= <const_int>
cfa.offset = cfa_store.offset if cfa.reg == sp
cfa.reg = sp
/* Rule 10 */
/* With a push. */
case PRE_MODIFY:
+ case POST_MODIFY:
/* We can't handle variable size modifications. */
gcc_assert (GET_CODE (XEXP (XEXP (XEXP (dest, 0), 1), 1))
== CONST_INT);
if (cfa.reg == STACK_POINTER_REGNUM)
cfa.offset = cfa_store.offset;
- offset = -cfa_store.offset;
+ if (GET_CODE (XEXP (dest, 0)) == POST_MODIFY)
+ offset -= cfa_store.offset;
+ else
+ offset = -cfa_store.offset;
break;
/* Rule 11 */
return local_scope_p (decl);
}
+/* Return non-zero if this DIE contains a defining declaration of a
+ subprogram. */
+
+static int
+contains_subprogram_definition (dw_die_ref die)
+{
+ dw_die_ref c;
+
+ if (die->die_tag == DW_TAG_subprogram && ! is_declaration_die (die))
+ return 1;
+ FOR_EACH_CHILD (die, c, if (contains_subprogram_definition(c)) return 1);
+ return 0;
+}
+
/* Return non-zero if this is a type DIE that should be moved to a
COMDAT .debug_types section. */
|| get_AT (die, DW_AT_abstract_origin)
|| is_nested_in_subprogram (die))
return 0;
+ /* A type definition should never contain a subprogram definition. */
+ gcc_assert (!contains_subprogram_definition (die));
return 1;
case DW_TAG_array_type:
case DW_TAG_interface_type:
}
else if (code == REFERENCE_TYPE)
{
- if (TYPE_REF_IS_RVALUE (type) && use_debug_types)
+ if (TYPE_REF_IS_RVALUE (type) && dwarf_version >= 4)
mod_type_die = new_die (DW_TAG_rvalue_reference_type, comp_unit_die (),
type);
else
break;
if (GET_MODE_CLASS (mode) == MODE_INT
&& GET_MODE_CLASS (GET_MODE (SUBREG_REG (rtl))) == MODE_INT
- && GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE
+ && (GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE
+#ifdef POINTERS_EXTEND_UNSIGNED
+ || (mode == Pmode && mem_mode != VOIDmode)
+#endif
+ )
&& GET_MODE_SIZE (GET_MODE (SUBREG_REG (rtl))) <= DWARF2_ADDR_SIZE)
{
mem_loc_result = mem_loc_descriptor (SUBREG_REG (rtl),
mem_loc_result = mem_loc_descriptor (SUBREG_REG (rtl),
GET_MODE (SUBREG_REG (rtl)),
- mode, initialized);
+ mem_mode, initialized);
if (mem_loc_result == NULL)
break;
type_die = base_type_for_mode (mode, 0);
case REG:
if (GET_MODE_CLASS (mode) != MODE_INT
- || GET_MODE_SIZE (mode) > DWARF2_ADDR_SIZE)
+ || (GET_MODE_SIZE (mode) > DWARF2_ADDR_SIZE
+#ifdef POINTERS_EXTEND_UNSIGNED
+ && (mode != Pmode || mem_mode == VOIDmode)
+#endif
+ ))
{
dw_die_ref type_die;
pool. */
case CONST:
case SYMBOL_REF:
- if (GET_MODE_SIZE (mode) > DWARF2_ADDR_SIZE
- || GET_MODE_CLASS (mode) != MODE_INT)
+ if (GET_MODE_CLASS (mode) != MODE_INT
+ || (GET_MODE_SIZE (mode) > DWARF2_ADDR_SIZE
+#ifdef POINTERS_EXTEND_UNSIGNED
+ && (mode != Pmode || mem_mode == VOIDmode)
+#endif
+ ))
break;
if (GET_CODE (rtl) == SYMBOL_REF
&& SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE)
break;
case CONST_INT:
- if (GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE)
+ if (GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE
+#ifdef POINTERS_EXTEND_UNSIGNED
+ || (mode == Pmode
+ && mem_mode != VOIDmode
+ && trunc_int_for_mode (INTVAL (rtl), ptr_mode) == INTVAL (rtl))
+#endif
+ )
{
mem_loc_result = int_loc_descriptor (INTVAL (rtl));
break;
if (!decl
|| (TREE_CODE (decl) != VAR_DECL
- && TREE_CODE (decl) != CONST_DECL))
+ && TREE_CODE (decl) != CONST_DECL)
+ || (TREE_CODE (decl) == VAR_DECL
+ && !TREE_STATIC (decl)))
return false;
if (TREE_READONLY (decl)
{
dw_die_ref ref_die, scope_die = scope_die_for (type, context_die);
- if (TYPE_REF_IS_RVALUE (type) && use_debug_types)
+ if (TYPE_REF_IS_RVALUE (type) && dwarf_version >= 4)
ref_die = new_die (DW_TAG_rvalue_reference_type, scope_die, type);
else
ref_die = new_die (DW_TAG_reference_type, scope_die, type);