? DECL_FIELD_BITPOS (TREE_OPERAND (exp, 1))
: TREE_OPERAND (exp, 2));
+ /* If this field hasn't been filled in yet, don't go
+ past it. This should only happen when folding expressions
+ made during type construction. */
+ if (pos == 0)
+ break;
+
if (TREE_CODE (pos) == PLUS_EXPR)
{
tree constant, var;
/* If this was a bit-field, see if there is a mode that allows direct
access in case EXP is in memory. */
- if (mode == VOIDmode && *pbitpos % *pbitsize == 0)
+ if (mode == VOIDmode && *pbitsize != 0 && *pbitpos % *pbitsize == 0)
{
mode = mode_for_size (*pbitsize, MODE_INT, 0);
if (mode == BLKmode)
enum tree_code c = TREE_CODE (type);
target
= assign_stack_temp (mode, int_size_in_bytes (type), 0);
- if (c == RECORD_TYPE || c == UNION_TYPE || c == ARRAY_TYPE)
+ if (c == RECORD_TYPE || c == UNION_TYPE
+ || c == QUAL_UNION_TYPE || c == ARRAY_TYPE)
MEM_IN_STRUCT_P (target) = 1;
}
}
|| TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE
|| TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
|| TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE
+ || TREE_CODE (TREE_TYPE (exp)) == QUAL_UNION_TYPE
|| (TREE_CODE (exp1) == ADDR_EXPR
&& (exp2 = TREE_OPERAND (exp1, 0))
&& (TREE_CODE (TREE_TYPE (exp2)) == ARRAY_TYPE
|| TREE_CODE (TREE_TYPE (exp2)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (exp2)) == UNION_TYPE)))
+ || TREE_CODE (TREE_TYPE (exp2)) == UNION_TYPE
+ || TREE_CODE (TREE_TYPE (exp2)) == QUAL_UNION_TYPE)))
MEM_IN_STRUCT_P (temp) = 1;
MEM_VOLATILE_P (temp) = TREE_THIS_VOLATILE (exp);
#if 0 /* It is incorrect to set RTX_UNCHANGING_P here, because the fact that
tree tem = get_inner_reference (exp, &bitsize, &bitpos, &offset,
&mode1, &unsignedp, &volatilep);
+ /* If we got back the original object, something is wrong. Perhaps
+ we are evaluating an expression too early. In any event, don't
+ infinitely recurse. */
+ if (tem == exp)
+ abort ();
+
/* In some cases, we will be offsetting OP0's address by a constant.
So get it as a sum, if possible. If we will be using it
directly in an insn, we validate it. */
return GEN_INT (method_type_class);
if (code == RECORD_TYPE)
return GEN_INT (record_type_class);
- if (code == UNION_TYPE)
+ if (code == UNION_TYPE || code == QUAL_UNION_TYPE)
return GEN_INT (union_type_class);
if (code == ARRAY_TYPE)
return GEN_INT (array_type_class);