public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@adacore.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: Richard Biener <richard.guenther@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: make sincos take type from intrinsic formal, not from result assignment
Date: Mon, 12 Oct 2020 14:30:35 -0300	[thread overview]
Message-ID: <ortuuzl5c4.fsf@livre.home> (raw)
In-Reply-To: <3a9b8447-1a6f-49fd-808d-220e2614e1d1@suse.cz> ("Martin \=\?utf-8\?Q\?Li\=C5\=A1ka\=22's\?\= message of "Mon, 12 Oct 2020 10:44:39 +0200")

Hello, Martin,

On Oct 12, 2020, Martin Liška <mliska@suse.cz> wrote:

> It seems the patch caused quite some clang warnings:

> /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/gcc/builtins.c:2366:5:
> warning: comparison of different enumeration types in switch statement
> ('combined_fn' and 'built_in_function') [-Wenum-compare-switch]
> ...

Thanks for the report.

> Can we please fix them?

Here's the patch I'm just about to begin regstrapping.
I'll check it in, as obvious, once I'm done.

Thanks again,


mathfn_built_in_type case type fix

Martin Liška reported warnings about type mismatches in the cases in
the recently-introduced mathfn_built_in_type.  This patch adjusts the
macros to use the combined_fn enumerators rather than the
(currently same-numbered) built_in_function ones.

for  gcc/ChangeLog

	* builtins.c (mathfn_built_in_type): Use CFN_ enumerators.
---
 gcc/builtins.c |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/gcc/builtins.c b/gcc/builtins.c
index 3a77da2..3f799e5 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -2451,37 +2451,37 @@ tree
 mathfn_built_in_type (combined_fn fn)
 {
 #define CASE_MATHFN(MATHFN)			\
-  case BUILT_IN_##MATHFN:			\
+  case CFN_BUILT_IN_##MATHFN:			\
     return double_type_node;			\
-  case BUILT_IN_##MATHFN##F:			\
+  case CFN_BUILT_IN_##MATHFN##F:		\
     return float_type_node;			\
-  case BUILT_IN_##MATHFN##L:			\
+  case CFN_BUILT_IN_##MATHFN##L:		\
     return long_double_type_node;
 
 #define CASE_MATHFN_FLOATN(MATHFN)		\
   CASE_MATHFN(MATHFN)				\
-  case BUILT_IN_##MATHFN##F16:			\
+  case CFN_BUILT_IN_##MATHFN##F16:		\
     return float16_type_node;			\
-  case BUILT_IN_##MATHFN##F32:			\
+  case CFN_BUILT_IN_##MATHFN##F32:		\
     return float32_type_node;			\
-  case BUILT_IN_##MATHFN##F64:			\
+  case CFN_BUILT_IN_##MATHFN##F64:		\
     return float64_type_node;			\
-  case BUILT_IN_##MATHFN##F128:			\
+  case CFN_BUILT_IN_##MATHFN##F128:		\
     return float128_type_node;			\
-  case BUILT_IN_##MATHFN##F32X:			\
+  case CFN_BUILT_IN_##MATHFN##F32X:		\
     return float32x_type_node;			\
-  case BUILT_IN_##MATHFN##F64X:			\
+  case CFN_BUILT_IN_##MATHFN##F64X:		\
     return float64x_type_node;			\
-  case BUILT_IN_##MATHFN##F128X:		\
+  case CFN_BUILT_IN_##MATHFN##F128X:		\
     return float128x_type_node;
 
 /* Similar to above, but appends _R after any F/L suffix.  */
 #define CASE_MATHFN_REENT(MATHFN) \
-  case BUILT_IN_##MATHFN##_R:			\
+  case CFN_BUILT_IN_##MATHFN##_R:		\
     return double_type_node;			\
-  case BUILT_IN_##MATHFN##F_R:			\
+  case CFN_BUILT_IN_##MATHFN##F_R:		\
     return float_type_node;			\
-  case BUILT_IN_##MATHFN##L_R:			\
+  case CFN_BUILT_IN_##MATHFN##L_R:		\
     return long_double_type_node;
 
   switch (fn)


-- 
Alexandre Oliva, happy hacker
https://FSFLA.org/blogs/lxo/
Free Software Activist
GNU Toolchain Engineer

      reply	other threads:[~2020-10-12 17:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06  1:15 Alexandre Oliva
2020-10-06  5:25 ` Richard Biener
2020-10-06  7:21   ` Alexandre Oliva
2020-10-06  8:10     ` Richard Biener
2020-10-06  9:34       ` Alexandre Oliva
2020-10-06 13:36         ` Richard Biener
2020-10-07 17:14           ` Alexandre Oliva
2020-10-08 11:46             ` Richard Biener
2020-10-08 20:06               ` Alexandre Oliva
2020-10-12  8:44                 ` Martin Liška
2020-10-12 17:30                   ` Alexandre Oliva [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ortuuzl5c4.fsf@livre.home \
    --to=oliva@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).