This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR 61876: Do not convert cast + __builtin_round into __builtin_lround unless -fno-math-errno is used
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 24 Jul 2014 14:51:51 +0200
- Subject: Re: [PATCH] PR 61876: Do not convert cast + __builtin_round into __builtin_lround unless -fno-math-errno is used
- Authentication-results: sourceware.org; auth=none
- References: <53D0FDD9 dot 1090408 at arm dot com>
On Thu, Jul 24, 2014 at 2:36 PM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> Hi all,
>
> This fixes PR 61876 by not converting the round + cast into an lround unless
> -fno-math-errno is specified.
> This is because lround can potentially set math errno whereas round + cast
> doesn't, so the transformation isn't universally valid.
>
> This will cause the tests:
> gcc.target/aarch64/fcvt_double_long.c
> gcc.target/aarch64/fcvt_double_ulong.c
>
> to start passing on aarch64-linux.
>
> aarch64 and x86 bootstrap and regtest looks fine.
>
> Ok for trunk?
Ok. Does this really only apply to the round() case and not to all
the others (floor, ceil, rint) as well?
Thanks,
Richard.
> 2014-06-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> PR middle-end/61876
> * convert.c (convert_to_integer): Do not convert BUILT_IN_ROUND and cast
> when flat_errno_math is on.