This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR 48981 aliasing bug inside GCC
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 27 May 2011 09:32:41 +0200
- Subject: Re: [PATCH] Fix PR 48981 aliasing bug inside GCC
- References: <BANLkTimt1ox2WPARji0yvMzw+85H6F=x0w@mail.gmail.com>
On Thu, May 26, 2011 at 11:56 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> The problem here is that vec.c accesses VEC_<type>_base via a
> vec_prefix but VEC_<type>_base's first field is not a vec_prefix.
> This patch fixes the problem by changing how VEC_*_base is done by
> using vec_prefix as the real base.
>
> OK? Bootstrapped and tested on x86_64 without any regressions.
Ok.
Thanks for fixing this!
Richard.
> Thanks,
> Andrew Pinski
>
> ChangeLog:
> * gengtype.c (vec_prefix_type): New function.
> (note_def_vec): Use vec_prefix_type and change the length
> attribute to be based on the prefix.
> * vec.c: Include coretypes.h before vec.h.
> (struct vec_prefix): Remove.
> (vec_gc_p_reserve): Change the offsetof to sizeof.
> (vec_gc_p_reserve_exact): Likewise.
> (vec_heap_p_reserve): Likewise.
> (vec_heap_p_reserve_exact): Likewise.
> (vec_stack_o_reserve_1): Copy from +1 instead of from vec.
> (vec_stack_p_reserve): Change the offsetof to sizeof.
> (vec_stack_p_reserve_exact): Likewise.
> * vec.h (struct vec_prefix): New struct definition.
> (VEC_T(T,B)): Use vec_prefix instead of having num/alloc fields.
> (VEC_T_GTY(T,B)): Likewise.
> (DEF_VEC_FUNC_P(T)): Use prefix field.
> (DEF_VEC_NONALLOC_FUNCS_O(T,A)): Likewise.
> (DEF_VEC_NONALLOC_FUNCS_I(T,A)): Likewise.
>