This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ubsan -fsanitize=signed-integer-overflow expansion (PR sanitizer/63520)
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, ebotcazou at adacore dot com
- Date: Wed, 19 Nov 2014 10:36:26 +0100 (CET)
- Subject: Re: [PATCH] Fix ubsan -fsanitize=signed-integer-overflow expansion (PR sanitizer/63520)
- Authentication-results: sourceware.org; auth=none
- References: <20141118220447 dot GT1745 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1411191001360 dot 374 at zhemvz dot fhfr dot qr> <20141119091626 dot GZ1745 at tucnak dot redhat dot com>
On Wed, 19 Nov 2014, Jakub Jelinek wrote:
> On Wed, Nov 19, 2014 at 10:02:18AM +0100, Richard Biener wrote:
> > On Tue, 18 Nov 2014, Jakub Jelinek wrote:
> > > Apparently, expand_expr with EXPR_WRITE can return
> > > a SUBREG with SUBREG_PROMOTED_VAR_P set on it. For
> >
> > Huh, that looks bogus to me. But of course I know nothing
> > (read: not enough) to really tell. Eric?
>
> I've tried to look where it comes from, and it dates back to r2xxx
> or so, so forever.
> And store_expr has a large:
> else if (GET_CODE (target) == SUBREG && SUBREG_PROMOTED_VAR_P (target))
> /* If this is a scalar in a register that is stored in a wider mode
> than the declared mode, compute the result into its declared mode
> and then convert to the wider mode. Our value is the computed
> expression. */
> handling block. For targets with only word sized operations something
> like that actually makes a lot of sense, I have just not been aware of that.
Ok. Then the patch is ok.
Thanks,
Richard.