public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pinski <apinski@marvell.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <fortran@gcc.gnu.org>, Andrew Pinski <apinski@marvell.com>
Subject: [PATCH] libfortran: Fix build for targets that don't have 10byte or 16 byte floating point
Date: Thu, 20 Jul 2023 22:29:11 -0700	[thread overview]
Message-ID: <20230721052911.1514944-1-apinski@marvell.com> (raw)

So the problem here is EXPAND_INTER_MACRO_16 expands to nothing if 16 byte FP does not
exist but we still add a comma after it and that causes a build failure.
The same is true for EXPAND_INTER_MACRO_10 too.

Committed as obvious after a bootstrap and test on x86_64-linux-gnu and aarch64-linux-gnu.

libgfortran/ChangeLog:

	PR libfortran/110759
	* ieee/ieee_arithmetic.F90
	(COMP_INTERFACE): Remove the comma after EXPAND_INTER_MACRO_16
	and EXPAND_INTER_MACRO_10.
	(EXPAND_INTER_MACRO_16): Add comma here if 16 byte fp exist.
	(EXPAND_INTER_MACRO_10): Likewise.
---
 libgfortran/ieee/ieee_arithmetic.F90 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libgfortran/ieee/ieee_arithmetic.F90 b/libgfortran/ieee/ieee_arithmetic.F90
index aa897abae39..debe40449f4 100644
--- a/libgfortran/ieee/ieee_arithmetic.F90
+++ b/libgfortran/ieee/ieee_arithmetic.F90
@@ -535,13 +535,13 @@ UNORDERED_MACRO(4,4)
   end interface
 
 #ifdef HAVE_GFC_REAL_16
-#  define EXPAND_INTER_MACRO_16(TYPE,OP) _gfortran_ieee_/**/TYPE/**/_/**/OP/**/_16
+#  define EXPAND_INTER_MACRO_16(TYPE,OP) _gfortran_ieee_/**/TYPE/**/_/**/OP/**/_16 ,
 #else
 #  define EXPAND_INTER_MACRO_16(TYPE,OP)
 #endif
 
 #ifdef HAVE_GFC_REAL_10
-#  define EXPAND_INTER_MACRO_10(TYPE,OP) _gfortran_ieee_/**/TYPE/**/_/**/OP/**/_10
+#  define EXPAND_INTER_MACRO_10(TYPE,OP) _gfortran_ieee_/**/TYPE/**/_/**/OP/**/_10 ,
 #else
 #  define EXPAND_INTER_MACRO_10(TYPE,OP)
 #endif
@@ -549,8 +549,8 @@ UNORDERED_MACRO(4,4)
 #define COMP_INTERFACE(TYPE,OP) \
   interface IEEE_/**/TYPE/**/_/**/OP ; \
     procedure \
-      EXPAND_INTER_MACRO_16(TYPE,OP) , \
-      EXPAND_INTER_MACRO_10(TYPE,OP) , \
+      EXPAND_INTER_MACRO_16(TYPE,OP) \
+      EXPAND_INTER_MACRO_10(TYPE,OP) \
       _gfortran_ieee_/**/TYPE/**/_/**/OP/**/_8 , \
       _gfortran_ieee_/**/TYPE/**/_/**/OP/**/_4 ; \
   end interface ; \
-- 
2.31.1


                 reply	other threads:[~2023-07-21  5:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230721052911.1514944-1-apinski@marvell.com \
    --to=apinski@marvell.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /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).