diff mbox series

rs6000: Fix use of wrong enum for built-in function code.

Message ID 99a1ea40-037b-815c-6d7a-c1b987e6d887@linux.ibm.com
State Committed
Commit 987baa7444a96ac769ba520cfa4f5a64ee647103
Headers show
Series rs6000: Fix use of wrong enum for built-in function code. | expand

Commit Message

Bill Schmidt via Gcc-patches Dec. 2, 2021, 10:53 p.m. UTC
Hi!

I discovered this bug while working on patches to remove the old built-ins
infrastructure.  I missed a spot in converting from the rs6000_builtins enum to
the rs6000_gen_builtins enum.  This fixes it.  The fix is technically not right
if new_builtins_are_enabled were to be set to zero, but we're not going to do
that anymore, and the remnants of that code will be removed shortly.

Regstrap is in progress on powerpc64le-linux-gnu.  Assuming no problems, is this
okay to commit to trunk?

Thanks!
Bill


2021-12-02  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000.c (rs6000_builtin_reciprocal): Fix builtin
	identifiers.
---
 gcc/config/rs6000/rs6000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Segher Boessenkool Dec. 3, 2021, 4:26 p.m. UTC | #1
Hi!

On Thu, Dec 02, 2021 at 04:53:18PM -0600, Bill Schmidt wrote:
> I discovered this bug while working on patches to remove the old built-ins
> infrastructure.  I missed a spot in converting from the rs6000_builtins enum to
> the rs6000_gen_builtins enum.  This fixes it.  The fix is technically not right
> if new_builtins_are_enabled were to be set to zero, but we're not going to do
> that anymore, and the remnants of that code will be removed shortly.

> gcc/
> 	* config/rs6000/rs6000.c (rs6000_builtin_reciprocal): Fix builtin
> 	identifiers.

What an informative changelog ;-)

Okay for trunk.  Thanks!


Segher
Bill Schmidt via Gcc-patches Dec. 3, 2021, 5:57 p.m. UTC | #2
On 12/3/21 10:26 AM, Segher Boessenkool wrote:
> Hi!
>
> On Thu, Dec 02, 2021 at 04:53:18PM -0600, Bill Schmidt wrote:
>> I discovered this bug while working on patches to remove the old built-ins
>> infrastructure.  I missed a spot in converting from the rs6000_builtins enum to
>> the rs6000_gen_builtins enum.  This fixes it.  The fix is technically not right
>> if new_builtins_are_enabled were to be set to zero, but we're not going to do
>> that anymore, and the remnants of that code will be removed shortly.
>> gcc/
>> 	* config/rs6000/rs6000.c (rs6000_builtin_reciprocal): Fix builtin
>> 	identifiers.
> What an informative changelog ;-)
>
> Okay for trunk.  Thanks!

Thanks!  Pushed as r12-5776.

Bill

>
>
> Segher
diff mbox series

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 945157b1c1a..0c18e69b012 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -22741,7 +22741,7 @@  rs6000_builtin_reciprocal (tree fndecl)
 {
   switch (DECL_MD_FUNCTION_CODE (fndecl))
     {
-    case VSX_BUILTIN_XVSQRTDP:
+    case RS6000_BIF_XVSQRTDP:
       if (!RS6000_RECIP_AUTO_RSQRTE_P (V2DFmode))
 	return NULL_TREE;
 
@@ -22749,7 +22749,7 @@  rs6000_builtin_reciprocal (tree fndecl)
 	return rs6000_builtin_decls_x[RS6000_BIF_RSQRT_2DF];
       return rs6000_builtin_decls[VSX_BUILTIN_RSQRT_2DF];
 
-    case VSX_BUILTIN_XVSQRTSP:
+    case RS6000_BIF_XVSQRTSP:
       if (!RS6000_RECIP_AUTO_RSQRTE_P (V4SFmode))
 	return NULL_TREE;