This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix convert_mode
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jeff Law <law at redhat dot com>, Eric Botcazou <ebotcazou at adacore dot com>, Richard Biener <rguenther at suse dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 17 Dec 2013 07:23:58 +0100
- Subject: Re: [PATCH] Fix convert_mode
- Authentication-results: sourceware.org; auth=none
- References: <20131216214437 dot 40A86104 at mailhost dot lps dot ens dot fr> <CAMe9rOr_EH5QQfT=JiMA3T1eOHEuU+-o1y3SRHKu8Gq-t=9Zxw at mail dot gmail dot com> <20131216221239 dot GY892 at tucnak dot redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Dec 16, 2013 at 11:12:40PM +0100, Jakub Jelinek wrote:
> When testing the patch the overflow-2.c testcase didn't exist yet,
> nor was ubsan on -m32 actually ever reporting overflows on the DImode
> multiplication (it simply expanded it as normal DImode multiplication with
> no overflow checking).
>
> To me this looks like very old bug (r2174 added it), will bootstrap/regtest
> this:
>
> 2013-12-16 Jakub Jelinek <jakub@redhat.com>
>
> * expr.c (convert_modes): For SUBREG_PROMOTED_VAR_P use SUBREG_REG (x)
> instead of x as last gen_lowpart argument.
>
> --- gcc/expr.c.jj 2013-12-12 09:39:45.000000000 +0100
> +++ gcc/expr.c 2013-12-16 23:05:07.519747459 +0100
> @@ -719,7 +719,7 @@ convert_modes (enum machine_mode mode, e
> if (GET_CODE (x) == SUBREG && SUBREG_PROMOTED_VAR_P (x)
> && GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))) >= GET_MODE_SIZE (mode)
> && SUBREG_PROMOTED_UNSIGNED_P (x) == unsignedp)
> - x = gen_lowpart (mode, x);
> + x = gen_lowpart (mode, SUBREG_REG (x));
>
> if (GET_MODE (x) != VOIDmode)
> oldmode = GET_MODE (x);
>
Successfully bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?
Jakub