This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: force_const_mem VOIDmode
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 7 Jun 2013 10:47:37 +0200
- Subject: Re: force_const_mem VOIDmode
- References: <20130607020053 dot GJ6878 at bubble dot grove dot modra dot org>
On Fri, Jun 7, 2013 at 4:00 AM, Alan Modra <amodra@gmail.com> wrote:
> force_const_mem() isn't supposed to handle VOIDmode or BLKmode, so the
> check for VOIDmode when aligning is needless. If we ever did get one
> of these modes in a constant pool, this
>
> pool->offset += GET_MODE_SIZE (mode);
>
> won't add to the pool size, and output_constant_pool_2() will hit a
> gcc_unreachable(). Bootstrapped etc. powerpc64-linux.
Ok.
Thanks,
Richard.
> * varasm.c (force_const_mem): Assert mode is not VOID or BLK.
>
> Index: gcc/varasm.c
> ===================================================================
> --- gcc/varasm.c (revision 199718)
> +++ gcc/varasm.c (working copy)
> @@ -3567,7 +3575,8 @@
> *slot = desc;
>
> /* Align the location counter as required by EXP's data type. */
> - align = GET_MODE_ALIGNMENT (mode == VOIDmode ? word_mode : mode);
> + gcc_checking_assert (mode != VOIDmode && mode != BLKmode);
> + align = GET_MODE_ALIGNMENT (mode);
> #ifdef CONSTANT_ALIGNMENT
> {
> tree type = lang_hooks.types.type_for_mode (mode, 0);
>
> --
> Alan Modra
> Australia Development Lab, IBM