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] ICE caused by calling simplify_subreg with BLKmode


Andreas Krebbel <Andreas.Krebbel@de.ibm.com> writes:
> *************** avoid_constant_pool_reference (rtx x)
> *** 183,199 ****
>         c = get_pool_constant (addr);
>         cmode = get_pool_mode (addr);
>   
>         /* If we're accessing the constant in a different mode than it was
>            originally stored, attempt to fix that up via subreg simplifications.
>            If that fails we have no choice but to return the original memory.  */
> !       if (offset != 0 || cmode != GET_MODE (x))
> !         {
>             rtx tem = simplify_subreg (GET_MODE (x), c, cmode, offset);
>             if (tem && CONSTANT_P (tem))
>               return tem;
>           }
> -       else
> -         return c;
>       }
>   
>     return x;
> --- 183,200 ----
>         c = get_pool_constant (addr);
>         cmode = get_pool_mode (addr);
>   
> +       if (offset == 0 && cmode == GET_MODE (x))
> + 	return c;
> + 
>         /* If we're accessing the constant in a different mode than it was
>            originally stored, attempt to fix that up via subreg simplifications.
>            If that fails we have no choice but to return the original memory.  */
> !       if (GET_MODE (x) != BLKmode)
> ! 	{
>             rtx tem = simplify_subreg (GET_MODE (x), c, cmode, offset);
>             if (tem && CONSTANT_P (tem))
>               return tem;
>           }
>       }

AIUI, we should never have a BLKmode constant pool entry, so perhaps
it would be clearer to add a BLKmode shortcut to the MEM case.
Just a suggestion though.

Richard


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