}
gsi_remove (&gsi, true);
}
- /* Fill SSA name gaps, putting them on the freelist. */
+ /* Fill SSA name gaps, putting them on the freelist and diagnose
+ SSA names without definition. */
for (unsigned i = 1; i < num_ssa_names; ++i)
if (!ssa_name (i))
{
tree name = make_ssa_name_fn (cfun, integer_type_node, NULL, i);
release_ssa_name_fn (cfun, name);
}
+ else if (!SSA_NAME_DEF_STMT (ssa_name (i)))
+ error ("SSA name %qE with version %d has no definition",
+ ssa_name (i), i);
/* No explicit virtual operands (yet). */
bitmap_obstack_initialize (NULL);
update_ssa (TODO_update_ssa_only_virtuals);
/* Handle SSA name decls specially, they do not go into the identifier
table but we simply build the SSA name for later lookup. */
unsigned version, ver_offset;
- if (declarator->kind == cdk_id
- && is_gimple_reg_type (specs->type)
- && c_parser_parse_ssa_name_id (declarator->u.id.id,
+ /* Handle SSA pointer declarations in a very simplistic ways, we
+ probably would like to call grokdeclarator in a special mode to
+ just build the type of the decl - start_decl already pushes
+ the identifier to the bindings for lookup, something we do not
+ want. */
+ struct c_declarator *id_declarator = declarator;
+ while (id_declarator->kind == cdk_pointer)
+ id_declarator = id_declarator->declarator;
+ if (id_declarator->kind == cdk_id
+ && (declarator->kind == cdk_pointer
+ || is_gimple_reg_type (specs->type))
+ && c_parser_parse_ssa_name_id (id_declarator->u.id.id,
&version, &ver_offset)
/* The following restricts it to unnamed anonymous SSA names
which fails parsing of named ones in dumps (we could
decide to not dump their name for -gimple). */
&& ver_offset == 0)
- c_parser_parse_ssa_name (parser, declarator->u.id.id, specs->type,
- version, ver_offset);
+ {
+ struct c_declarator *p = declarator;
+ tree type = specs->type;
+ while (p->kind == cdk_pointer)
+ {
+ type = build_pointer_type (type);
+ p = p->declarator;
+ }
+ c_parser_parse_ssa_name (parser, id_declarator->u.id.id, type,
+ version, ver_offset);
+ }
else
{
tree postfix_attrs = NULL_TREE;