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: Do not use TYPE_CANONICAL in useless_type_conversion


> 
> 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.


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