This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix gnat.dg regressions and sizetype change fallouts
- From: Richard Biener <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: Wed, 28 Nov 2012 11:43:08 +0100
- Subject: Re: [patch] Fix gnat.dg regressions and sizetype change fallouts
- References: <2973671.gMgZJMRTIz@polaris>
On Tue, Nov 27, 2012 at 5:39 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> this fixes the couple of gnat.dg regressions on all platforms introduced by
> the sizetype changes, as well as finishes the conversion of the Ada compiler
> to the new scheme by invoking valid_constant_size_p and size_binop in the
> appropriate places.
>
> The 2 regressions were introduced by the kludge added to layout_type to deal
> with overflowed zeroes. As such, the kludge is wrong, since something like:
>
> type Arr is array(Long_Integer) of Boolean;
>
> in Ada already yields a really overflowed zero. So the patch adds a kludge to
> the kludge, with the appropriate ??? comment this time.
>
> Tested on i586-suse-linux and x86-64-suse-linux, OK for the mainline?
Ok.
Thanks,
Richard.
>
> 2012-11-27 Eric Botcazou <ebotcazou@adacore.com>
>
> * stor-layout.c (layout_type) <ARRAY_TYPE>: Do not clear TREE_OVERFLOW
> on overflowed zeroes, except in one specific case.
> ada/
> * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Use
> valid_constant_size_p to detect too large objects.
> <E_Subprogram_Type>: Likewise for too large return types.
> (allocatable_size_p): Call valid_constant_size_p in the fixed case.
> (annotate_value) <INTEGER_CST>: Adjust to sizetype changes.
> * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Use
> valid_constant_size_p to detect too large objects on the LHS.
> * gcc-interface/misc.c (default_pass_by_ref): Likewise for large types.
> And use TYPE_SIZE_UNIT throughout.
> (must_pass_by_ref): Likewise.
> * gcc-interface/utils.c (max_size) <tcc_unary>: Split from common case.
> <tcc_binary>: Likewise. Call size_binop instead of fold_build2.
> <tcc_expression>: Simplify.
> * gcc-interface/utils2.c (build_allocator): Use valid_constant_size_p
> to detect too large allocations.
>
>
> 2012-11-27 Eric Botcazou <ebotcazou@adacore.com>
>
> * gnat.dg/object_overflow.adb: Rename to...
> * gnat.dg/object_overflow1.adb: ...this.
> * gnat.dg/object_overflow2.adb: New test.
> * gnat.dg/object_overflow3.adb: Likewise.
> * gnat.dg/object_overflow4.adb: Likewise.
>
>
> --
> Eric Botcazou