This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, PR 57748] Check for out of bounds access, Part 2

> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]