[PATCH] Fix PR88074 - take 2
Jeff Law
law@redhat.com
Wed Feb 20 22:32:00 GMT 2019
On 2/20/19 3:22 PM, Jakub Jelinek wrote:
> On Wed, Feb 20, 2019 at 06:29:06PM +0000, Joseph Myers wrote:
>> On Wed, 20 Feb 2019, Jakub Jelinek wrote:
>>
>>> + /* mpc_norm assumes it can square a number without bothering with
>>> + with range scaling, so until that is fixed, double the minimum
>>> + and maximum exponents, plus add some buffer for arithmetics
>>> + on the squared numbers. */
>>
>> Note that I think such issues are pervasive in MPC; it's not just that one
>> function. MPFR is generally careful about using a larger exponent range
>> internally (there might still be issues with very big exponents where they
>> aren't handled specially to avoid internal overflow, but the maximum MPFR
>> exponent range is very large); MPC doesn't generally try to handle
>> restricted exponent ranges.
>
> I've added E.g. to the comment, is that sufficient, or are you aware of some
> mpc computation that will misbehave even with those 2 * max_exp + 2 etc.
> ranges?
>
> Bootstrapped/regtested now on x86_64-linux and i686-linux successfully and
> various people tested it on other targets, ok for trunk?
>
> 2019-02-20 Jakub Jelinek <jakub@redhat.com>
>
> PR middle-end/88074
> PR middle-end/89415
> * toplev.c (do_compile): Double the emin/emax exponents to workaround
> buggy mpc_norm.
>
> * gcc.dg/pr88074-2.c: New test.
FWIW, s390x, sparc64 and aarch64 all bootstrapped and regression tested
with this patch.
Assuming we didn't reintroduce the original issue with 88074, OK since
it just widens the exponents range.
jeff
More information about the Gcc-patches
mailing list