This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Do not use TYPE_CANONICAL in useless_type_conversion
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Richard Biener <rguenther at suse dot de>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Bernd Schmidt <bschmidt at redhat dot com>, Eric Botcazou <ebotcazou at adacore dot com>, gcc-patches at gcc dot gnu dot org, law at redhat dot com
- Date: Tue, 6 Oct 2015 19:54:37 +0200
- Subject: Re: Do not use TYPE_CANONICAL in useless_type_conversion
- Authentication-results: sourceware.org; auth=none
- References: <20150930211235 dot GB30640 at kam dot mff dot cuni dot cz> <20151002160245 dot GA84720 at kam dot mff dot cuni dot cz> <20151002180022 dot GA32564 at kam dot mff dot cuni dot cz> <11111201 dot hIrLzgQcuo at polaris> <20151002214127 dot GC84720 at kam dot mff dot cuni dot cz> <20151002215225 dot GA14667 at kam dot mff dot cuni dot cz> <56126C73 dot 4070205 at redhat dot com> <20151005153458 dot GB9972 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1510061304480 dot 6516 at zhemvz dot fhfr dot qr>
>
> The patch works for me but I'm not sure about the store_expr_with_bounds
> change. Where does the actual copying take place? adjust_address_nv
> just adjusts the mode ...
Yep, the mode was supposed to happen in the later path where we emit block moves,
but i missed an else there. I will update the patch. Thanks for catching this.
Honza
>
> Index: gcc/expr.c
> ===================================================================
> --- gcc/expr.c (revision 228514)
> +++ gcc/expr.c (working copy)
> @@ -5462,7 +5462,7 @@ store_expr_with_bounds (tree exp, rtx ta
> {
> if (GET_MODE (temp) != GET_MODE (target) && GET_MODE (temp) !=
> VOIDmode)
> {
> - if (GET_MODE (target) == BLKmode)
> + if (GET_MODE (target) == BLKmode || MEM_P (target))
> {
> /* Handle calls that return BLKmode values in registers. */
> if (REG_P (temp) && TREE_CODE (exp) == CALL_EXPR)
>
> works for me as well (for the testcase that ICEd for you) and it
> definitely will emit the copy. Basically if it is a MEM the mode
> should be irrelevant (do we have BLKmode things that are _not_ MEMs?).
>
> Anyway, your expr.c hunk looks wrong (no copy) and I'll let somebody
> more familiar with that area do the sort-out. Unfortunately
> that ICEing testcase isn't a runtime one ;)
>
> Richard.