This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Remove obsolete code in layout_type
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 20 Sep 2009 23:17:36 +0200
- Subject: Re: [Patch] Remove obsolete code in layout_type
- References: <200909202316.08773.ebotcazou@adacore.com>
On Sun, Sep 20, 2009 at 11:16 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> a complete bootstrap/regtest cycle has succeeded with the following assert
>
> Index: stor-layout.c
> ===================================================================
> --- stor-layout.c ? ? ? (revision 151898)
> +++ stor-layout.c ? ? ? (working copy)
> @@ -1998,6 +1998,8 @@ layout_type (tree type)
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fold_convert (bitsizetype,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? length));
>
> + ? ? ? ? ? gcc_assert (!integer_onep (element_size));
> +
> ? ? ? ? ? ?/* If we know the size of the element, calculate the total
> ? ? ? ? ? ? ? size directly, rather than do some division thing below.
> ? ? ? ? ? ? ? This optimization helps Fortran assumed-size arrays
>
> on x86_64-suse-linux so it looks like the code just above
>
> ? ? ? ? ? ?/* Special handling for arrays of bits (for Chill). ?*/
> ? ? ? ? ? ?element_size = TYPE_SIZE (element);
> ? ? ? ? ? ?if (TYPE_PACKED (type) && INTEGRAL_TYPE_P (element)
> ? ? ? ? ? ? ? ?&& (integer_zerop (TYPE_MAX_VALUE (element))
> ? ? ? ? ? ? ? ? ? ?|| integer_onep (TYPE_MAX_VALUE (element)))
> ? ? ? ? ? ? ? ?&& host_integerp (TYPE_MIN_VALUE (element), 1))
> ? ? ? ? ? ? ?{
> ? ? ? ? ? ? ? ?HOST_WIDE_INT maxvalue
> ? ? ? ? ? ? ? ? ?= tree_low_cst (TYPE_MAX_VALUE (element), 1);
> ? ? ? ? ? ? ? ?HOST_WIDE_INT minvalue
> ? ? ? ? ? ? ? ? ?= tree_low_cst (TYPE_MIN_VALUE (element), 1);
>
> ? ? ? ? ? ? ? ?if (maxvalue - minvalue == 1
> ? ? ? ? ? ? ? ? ? ?&& (maxvalue == 1 || maxvalue == 0))
> ? ? ? ? ? ? ? ? ?element_size = integer_one_node;
> ? ? ? ? ? ? ?}
>
> is really obsolete. ?Hence the attached patch, retested on i586-suse-linux.
>
> OK for mainline?
Ok.
Thanks,
Richard.
>
> 2009-09-20 ?Eric Botcazou ?<ebotcazou@adacore.com>
>
> ? ? ? ?* stor-layout.c (layout_type): Remove obsolete code.
>
>
> --
> Eric Botcazou
>