This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][LTO] Fix PR41715


On Thu, Oct 15, 2009 at 12:02, Richard Guenther <rguenther@suse.de> wrote:
>
> When rewriting symbol merging last time I introduced VIEW_CONVERT_EXPRs
> at the time replacing the decls with their prevailing ones. ÂThis
> causes V_C_Es to leak into places they are not supposed to be. ÂUgh.

Too bad.  I liked the simplicity of that approach better.
Regimplification wouldn't have solved this?

> + Â switch (TREE_CODE (op))
> + Â Â {
> + Â Â case COMPONENT_REF:
> + Â Â Â /* Ugh. ÂBut we can't really do better. Â*/
> + Â Â Â wanted_type = DECL_CONTEXT (TREE_OPERAND (op, 1));
> + Â Â Â break;

Add additional comment that explains that the DECL_CONTEXT of the
field is the RECORD_TYPE we are looking for.

> + Â /* We have to fixup replaced decls here in case there were
> + Â Â Âinter-TU type mismatches. ÂCatch the most common cases
> + Â Â Âfor now - this way we'll get testcases for the rest as
> + Â Â Âthe type verifier will complain. Â*/
> + Â if (gimple_assign_single_p (stmt))
> + Â Â {
> + Â Â Â tree lhs = gimple_assign_lhs (stmt);
> + Â Â Â tree rhs = gimple_assign_rhs1 (stmt);
> +
> + Â Â Â /* First catch loads and aggregate copies by adjusting the rhs. Â*/
> + Â Â Â if (TREE_CODE (rhs) == VAR_DECL)
> + Â Â Â {
> + Â Â Â Â if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
> + Â Â Â Â Â gimple_assign_set_rhs1 (stmt, build1 (VIEW_CONVERT_EXPR,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â TREE_TYPE (lhs), rhs));
> + Â Â Â }
> + Â Â Â else if (handled_component_p (rhs))
> + Â Â Â maybe_fixup_handled_component (rhs);
> + Â Â Â /* Then catch scalar stores. Â*/
> + Â Â Â else if (TREE_CODE (lhs) == VAR_DECL)
> + Â Â Â {
> + Â Â Â Â if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
> + Â Â Â Â Â gimple_assign_set_lhs (stmt, build1 (VIEW_CONVERT_EXPR,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ÂTREE_TYPE (rhs), lhs));
> + Â Â Â }
> + Â Â Â else if (handled_component_p (lhs))
> + Â Â Â maybe_fixup_handled_component (lhs);
> + Â Â }
> + Â else if (is_gimple_call (stmt))
> + Â Â {
> + Â Â Â tree lhs = gimple_call_lhs (stmt);
> +
> + Â Â Â if (lhs && TREE_CODE (lhs) == VAR_DECL)
> + Â Â Â {
> + Â Â Â Â if (!useless_type_conversion_p (TREE_TYPE (lhs),
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â gimple_call_return_type (stmt)))
> + Â Â Â Â Â gimple_call_set_lhs (stmt, build1 (VIEW_CONVERT_EXPR,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âgimple_call_return_type (stmt),
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âlhs));
> + Â Â Â }
> + Â Â Â else if (lhs && handled_component_p (lhs))
> + Â Â Â maybe_fixup_handled_component (lhs);
> +
> + Â Â Â /* Arguments, especially for varargs functions will be funny... Â*/
> + Â Â }
> +

Could this be factored out of input_gimple_stmt?

OK otherwise.


Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]