diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-10-28 10:24:20 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-10-28 10:24:20 +0100 |
commit | 279a9ce9d545f65a0bb1bc4564abafabfc25f82d (patch) | |
tree | df958d1e0e695632ae03c0146e37513e99eebff3 /gcc/c/c-parser.c | |
parent | 2241061463ad43de95eb7d3e07546bcb5efa8607 (diff) | |
download | gcc-279a9ce9d545f65a0bb1bc4564abafabfc25f82d.zip gcc-279a9ce9d545f65a0bb1bc4564abafabfc25f82d.tar.gz gcc-279a9ce9d545f65a0bb1bc4564abafabfc25f82d.tar.bz2 |
wide-int: Fix up set_bit_large
> >> wide_int new_lb = wi::set_bit (r.lower_bound (0), 127)
> >>
> >> and creates the value:
> >>
> >> p new_lb
> >> {<wide_int_storage> = {val = {-65535, -1, 0}, len = 2, precision = 128},
> >> static is_sign_extended = true}
> >
> > This is non-canonical and so invalid, if the low HWI has the MSB set
> > and the high HWI is -1, it should have been just
> > val = {-65535}, len = 1, precision = 128}
> >
> > I guess the bug is that wi::set_bit_large doesn't call canonize.
>
> Yeah, looks like a micro-optimisation gone wrong.
2020-10-28 Jakub Jelinek <jakub@redhat.com>
* wide-int.cc (wi::set_bit_large): Call canonize unless setting
msb bit and clearing bits above it.
Diffstat (limited to 'gcc/c/c-parser.c')
0 files changed, 0 insertions, 0 deletions