{
/* Reject incorrectly represented bit fields. */
if (DECL_BIT_FIELD (t)
+ && INTEGRAL_TYPE_P (TREE_TYPE (t))
&& (tree_low_cst (DECL_SIZE (t), 1)
!= TYPE_PRECISION (TREE_TYPE (t))))
goto fail;
/* HACK: if we decompose a va_list_type_node before inlining, then we'll
confuse tree-stdarg.c, and we won't be able to figure out which and
how many arguments are accessed. This really should be improved in
- tree-stdarg.c, as the decomposition is truely a win. This could also
+ tree-stdarg.c, as the decomposition is truly a win. This could also
be fixed if the stdarg pass ran early, but this can't be done until
we've aliasing information early too. See PR 30791. */
if (early_sra
if (elt)
elt->is_vector_lhs = true;
}
+
/* A bit field reference (access to *multiple* fields simultaneously)
- is not currently scalarized. Consider this an access to the
- complete outer element, to which walk_tree will bring us next. */
-
+ is not currently scalarized. Consider this an access to the full
+ outer element, to which walk_tree will bring us next. */
goto use_all;
- case VIEW_CONVERT_EXPR:
case NOP_EXPR:
- /* Similarly, a view/nop explicitly wants to look at an object in a
+ /* Similarly, a nop explicitly wants to look at an object in a
type other than the one we've scalarized. */
goto use_all;
+ case VIEW_CONVERT_EXPR:
+ /* Likewise for a view conversion, but with an additional twist:
+ it can be on the LHS and, in this case, an access to the full
+ outer element would mean a killing def. So we need to punt
+ if we haven't already a full access to the current element,
+ because we cannot pretend to have a killing def if we only
+ have a partial access at some level. */
+ if (is_output && !use_all_p && inner != expr)
+ disable_scalarization = true;
+ goto use_all;
+
case WITH_SIZE_EXPR:
/* This is a transparent wrapper. The entire inner expression really
is being used. */
tree type, var;
struct sra_elt *block;
+ /* Point fields are typically best handled as standalone entities. */
+ if (POINTER_TYPE_P (TREE_TYPE (f)))
+ return f;
+
if (!is_sra_scalar_type (TREE_TYPE (f))
|| !host_integerp (DECL_FIELD_OFFSET (f), 1)
|| !host_integerp (DECL_FIELD_BIT_OFFSET (f), 1)
{
tree field = elt->element;
- /* We can't test elt->in_bitfld_blk here because, when this is
+ /* We can't test elt->in_bitfld_block here because, when this is
called from instantiate_element, we haven't set this field
yet. */
if (TREE_CODE (field) == BIT_FIELD_REF)
var = TREE_OPERAND (src, 0);
width = TREE_OPERAND (src, 1);
/* The offset needs to be adjusted to a right shift quantity
- depending on the endianess. */
+ depending on the endianness. */
if (BYTES_BIG_ENDIAN)
{
tree tmp = size_binop (PLUS_EXPR, width, TREE_OPERAND (src, 2));
return flag_tree_sra != 0;
}
-struct tree_opt_pass pass_sra_early =
+struct gimple_opt_pass pass_sra_early =
{
+ {
+ GIMPLE_PASS,
"esra", /* name */
gate_sra, /* gate */
tree_sra_early, /* execute */
TODO_dump_func
| TODO_update_ssa
| TODO_ggc_collect
- | TODO_verify_ssa, /* todo_flags_finish */
- 0 /* letter */
+ | TODO_verify_ssa /* todo_flags_finish */
+ }
};
-struct tree_opt_pass pass_sra =
+struct gimple_opt_pass pass_sra =
{
+ {
+ GIMPLE_PASS,
"sra", /* name */
gate_sra, /* gate */
tree_sra, /* execute */
TODO_dump_func
| TODO_update_ssa
| TODO_ggc_collect
- | TODO_verify_ssa, /* todo_flags_finish */
- 0 /* letter */
+ | TODO_verify_ssa /* todo_flags_finish */
+ }
};