This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add more testing to ubsan #1
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Dominique Dhumieres <dominiq at lps dot ens dot fr>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Marek Polacek <polacek at redhat dot com>
- Date: Mon, 16 Dec 2013 23:12:40 +0100
- Subject: Re: [PATCH] Add more testing to ubsan #1
- 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>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Dec 16, 2013 at 01:50:09PM -0800, H.J. Lu wrote:
> On Mon, Dec 16, 2013 at 1:44 PM, Dominique Dhumieres <dominiq@lps.ens.fr> wrote:
> >> I got ...
> >
> > me too on x86_64-apple-darwin13 with -m32 (gcc and g++).
> > r206009 is OK, r206026 is not.
> >
>
> Mine is r206017 is OK and r206027 is bad. The change
> must be introduced between r2060178 and r206026.
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);
Jakub