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] Fix ICEs in simplify_immed_subreg on OImode/XImode subregs (PR target/63910)


On Nov 19, 2014, at 1:57 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Though, following patch is just fine for me too, I don't think it will
> make a significant difference:

This version is fine by me.

> --- gcc/simplify-rtx.c	2014-11-19 15:39:24.073113107 +0100
> +++ gcc/simplify-rtx.c	2014-11-19 22:55:44.201464253 +0100
> @@ -5504,6 +5504,8 @@ simplify_immed_subreg (machine_mode oute
> 	    HOST_WIDE_INT tmp[MAX_BITSIZE_MODE_ANY_INT / HOST_BITS_PER_WIDE_INT];
> 	    wide_int r;
> 
> +	    if (GET_MODE_PRECISION (outer_submode) > MAX_BITSIZE_MODE_ANY_INT)
> +	      return NULL_RTX;
> 	    for (u = 0; u < units; u++)
> 	      {
> 		unsigned HOST_WIDE_INT buf = 0;
> @@ -5515,10 +5517,13 @@ simplify_immed_subreg (machine_mode oute
> 		tmp[u] = buf;
> 		base += HOST_BITS_PER_WIDE_INT;
> 	      }
> -	    gcc_assert (GET_MODE_PRECISION (outer_submode)
> -			<= MAX_BITSIZE_MODE_ANY_INT);
> 	    r = wide_int::from_array (tmp, units,
> 				      GET_MODE_PRECISION (outer_submode));
> +#if TARGET_SUPPORTS_WIDE_INT == 0
> +	    /* Make sure r will fit into CONST_INT or CONST_DOUBLE.  */
> +	    if (wi::min_precision (r, SIGNED) > HOST_BITS_PER_DOUBLE_INT)
> +	      return NULL_RTX;
> +#endif


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