diff mbox series

Fix PR 101683: FP exceptions for float->unsigned

Message ID 1627672865-8822-1-git-send-email-apinski@marvell.com
State New
Headers show
Series Fix PR 101683: FP exceptions for float->unsigned | expand

Commit Message

Li, Pan2 via Gcc-patches July 30, 2021, 7:21 p.m. UTC
From: Andrew Pinski <apinski@marvell.com>

Just like the old bug PR9651, unsigned_fix rtl should
also be handled as a trapping instruction.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

	PR rtl-optimization/101683
	* rtlanal.c (may_trap_p_1): Handle UNSIGNED_FIX.
---
 gcc/rtlanal.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Richard Biener Aug. 2, 2021, 9:58 a.m. UTC | #1
On Fri, Jul 30, 2021 at 9:22 PM apinski--- via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> From: Andrew Pinski <apinski@marvell.com>
>
> Just like the old bug PR9651, unsigned_fix rtl should
> also be handled as a trapping instruction.
>
> OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

OK.

> gcc/ChangeLog:
>
>         PR rtl-optimization/101683
>         * rtlanal.c (may_trap_p_1): Handle UNSIGNED_FIX.
> ---
>  gcc/rtlanal.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
> index 3b8d88afd4d..f7f3acb75db 100644
> --- a/gcc/rtlanal.c
> +++ b/gcc/rtlanal.c
> @@ -3261,6 +3261,7 @@ may_trap_p_1 (const_rtx x, unsigned flags)
>        break;
>
>      case FIX:
> +    case UNSIGNED_FIX:
>        /* Conversion of floating point might trap.  */
>        if (flag_trapping_math && HONOR_NANS (XEXP (x, 0)))
>         return 1;
> --
> 2.27.0
>
diff mbox series

Patch

diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 3b8d88afd4d..f7f3acb75db 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -3261,6 +3261,7 @@  may_trap_p_1 (const_rtx x, unsigned flags)
       break;
 
     case FIX:
+    case UNSIGNED_FIX:
       /* Conversion of floating point might trap.  */
       if (flag_trapping_math && HONOR_NANS (XEXP (x, 0)))
 	return 1;