From 791536baadc9f469ec8eef2d7213c6f6091c5fa9 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 30 Apr 2019 11:16:36 +0200 Subject: [PATCH] Fix -Wenum-compare-switch warning in i386.c. 2019-04-30 Martin Liska * config/i386/i386.c (ix86_builtin_reciprocal): Cast DECL_FUNCTION_CODE into ix86_builtins enum before the switch statement. From-SVN: r270681 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff570068b43..e053ff1c102 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-04-30 Martin Liska + + * config/i386/i386.c (ix86_builtin_reciprocal): Cast + DECL_FUNCTION_CODE into ix86_builtins enum before + the switch statement. + 2019-04-30 Jakub Jelinek PR tree-optimization/89475 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d191e8c7b5b..43ee77606e5 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -39382,7 +39382,9 @@ use_rsqrt_p () static tree ix86_builtin_reciprocal (tree fndecl) { - switch (DECL_FUNCTION_CODE (fndecl)) + enum ix86_builtins fn_code + = (enum ix86_builtins) DECL_FUNCTION_CODE (fndecl); + switch (fn_code) { /* Vectorized version of sqrt to rsqrt conversion. */ case IX86_BUILTIN_SQRTPS_NR: -- 2.30.2