This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR tree-optimization/63828: [5 Regression] g++.dg/ipa/devirt-47.C fails for x32
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Thu, 13 Nov 2014 12:09:45 +0100
- Subject: Re: PATCH: PR tree-optimization/63828: [5 Regression] g++.dg/ipa/devirt-47.C fails for x32
- Authentication-results: sourceware.org; auth=none
- References: <20141112171803 dot GA4869 at intel dot com>
On Wed, Nov 12, 2014 at 6:18 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> possible_placement_new checks if the structure is at least big enough to
> hold the VPTR pointer. But it uses BITS_PER_WORD for pointer size,
> which is incorrect for many ILP32 targets. This patch replaces it with
> POINTER_SIZE. Tested on Linux/x32. OK for trunk?
Ok.
Thanks,
Richard.
> Thanks.
>
>
> H.J.
> ---
> 2014-11-12 H.J. Lu <hongjiu.lu@intel.com>
>
> PR tree-optimization/63828
> * ipa-polymorphic-call.c (possible_placement_new): Check
> POINTER_SIZE, instead of BITS_PER_WORD, for pointer size.
>
> diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c
> index 33dd1a8..30b5db2 100644
> --- a/gcc/ipa-polymorphic-call.c
> +++ b/gcc/ipa-polymorphic-call.c
> @@ -106,7 +106,7 @@ possible_placement_new (tree type, tree expected_type,
> {
> return ((TREE_CODE (type) != RECORD_TYPE
> || !TYPE_BINFO (type)
> - || cur_offset >= BITS_PER_WORD
> + || cur_offset >= POINTER_SIZE
> || !polymorphic_type_binfo_p (TYPE_BINFO (type)))
> && (!TYPE_SIZE (type)
> || !tree_fits_shwi_p (TYPE_SIZE (type))