public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH,rs6000] PR 844422 Fix FCTID, FCTIW with -mcpu=power7
@ 2018-03-15 15:07 Carl Love
  0 siblings, 0 replies; only message in thread
From: Carl Love @ 2018-03-15 15:07 UTC (permalink / raw)
  To: Segher Boessenkool, gcc-patches, David Edelsohn; +Cc: Bill Schmidt, cel

GCC Maintainers:

The following patch fixes an ICE when compiling the test case

  gcc -mcpu=power7 builtin-fctid-fctiw-runnable.c

The GCC compiler now gives a message 

    "error: builtin function ‘__builtin_fctiw’ requires the ‘-mpower8-
vector’ option" 

and exits without generating an internal error.

The patch has been tested by compiling by hand as given above.  The
regression testing has also been done on

  powerpc64-unknown-linux-gnu (Power 8 BE)
  powerpc64le-unknown-linux-gnu (Power 8 LE)
  powerpc64le-unknown-linux-gnu (Power 9 LE)

with no regressions.

Let me know if the patch looks OK or not. Thanks.

               Carl Love

-------------------------------------------------------------

gcc/ChangeLog:

2018-03-15  Carl Love  <cel@us.ibm.com>

	PR target/84422
	* config/rs6000/rs6000-builtin.def: Change macro expansion for FCTID,
	FCTIW to BU_P8V_MISC_1.
---
 gcc/config/rs6000/rs6000-builtin.def | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def
index 783ecff..9925364 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -658,6 +658,14 @@
 /* Miscellaneous builtins for instructions added in ISA 2.07.  These
    instructions do require the ISA 2.07 vector support, but they aren't vector
    instructions.  */
+#define BU_P8V_MISC_1(ENUM, NAME, ATTR, ICODE)				\
+  RS6000_BUILTIN_1 (MISC_BUILTIN_ ## ENUM,		/* ENUM */	\
+		    "__builtin_" NAME,			/* NAME */	\
+		    RS6000_BTM_P8_VECTOR,		/* MASK */	\
+		    (RS6000_BTC_ ## ATTR		/* ATTR */	\
+		     | RS6000_BTC_UNARY),				\
+		    CODE_FOR_ ## ICODE)			/* ICODE */
+
 #define BU_P8V_MISC_3(ENUM, NAME, ATTR, ICODE)				\
   RS6000_BUILTIN_3 (MISC_BUILTIN_ ## ENUM,		/* ENUM */	\
 		    "__builtin_" NAME,			/* NAME */	\
@@ -1881,8 +1889,8 @@ BU_VSX_OVERLOAD_X (XST,	     "xst")
 BU_VSX_OVERLOAD_X (XST_BE,   "xst_be")
 \f
 /* 1 argument builtins pre ISA 2.04.  */
-BU_FP_MISC_1 (FCTID,		"fctid",	CONST,  lrintdfdi2)
-BU_FP_MISC_1 (FCTIW,		"fctiw",	CONST,	lrintsfsi2)
+BU_P8V_MISC_1 (FCTID,		"fctid",	CONST,  lrintdfdi2)
+BU_P8V_MISC_1 (FCTIW,		"fctiw",	CONST,	lrintsfsi2)
 
 /* 2 argument CMPB instructions added in ISA 2.05. */
 BU_P6_2 (CMPB_32,        "cmpb_32",	CONST,	cmpbsi3)
-- 
2.7.4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-15 15:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15 15:07 [PATCH,rs6000] PR 844422 Fix FCTID, FCTIW with -mcpu=power7 Carl Love

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).