This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR 57748] Check for out of bounds access, Part 2
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Bernd Edlinger <bernd dot edlinger at hotmail dot de>, Martin Jambor <mjambor at suse dot cz>
- Date: Tue, 24 Sep 2013 16:19:30 +0200
- Subject: Re: [PATCH, PR 57748] Check for out of bounds access, Part 2
- Authentication-results: sourceware.org; auth=none
- References: <DUB122-W396D54115D70C9FF68A8D2E43C0 at phx dot gbl> <DUB122-W47C123A809B4FBF5146BE6E42E0 at phx dot gbl> <CAFiYyc3Rr0emS0OeEu7+gYvtmO2-754CLjqqMUtrwgUE5U8Dqw at mail dot gmail dot com>
> Index: gcc/expr.c
> ===================================================================
> --- gcc/expr.c (revision 202778)
> +++ gcc/expr.c (working copy)
> @@ -9878,7 +9878,7 @@
> && modifier != EXPAND_STACK_PARM
> ? target : NULL_RTX),
> VOIDmode,
> - modifier == EXPAND_SUM ? EXPAND_NORMAL : modifier);
> + EXPAND_MEMORY);
>
> /* If the bitfield is volatile, we want to access it in the
> field's mode, not the computed mode.
>
> context suggests that we may arrive with EXPAND_STACK_PARM here
> which is a correctness modifier (see its docs). But I'm not too familiar
> with the details of the various expand modifiers, Eric may be though.
Yes, this change looks far too bold and is presumably papering over the
underlying issue...
> That said, I still believe that fixing the misalign path in
> expand_assignment would be better than trying to avoid it. For this
> testcase the issue is again that expand_assignment passes the wrong
> mode/target to the
> movmisalign optab.
...then let's just fix the movmisalign stuff.
--
Eric Botcazou