public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r15-14] s390: avoid peeking eof after __vector
@ 2024-04-28  3:39 Jiu Fu Guo
  0 siblings, 0 replies; only message in thread
From: Jiu Fu Guo @ 2024-04-28  3:39 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:83bc41e8364360b63eaa59c88e2fb499a6751233

commit r15-14-g83bc41e8364360b63eaa59c88e2fb499a6751233
Author: Jiufu Guo <guojiufu@linux.ibm.com>
Date:   Wed Mar 27 14:15:40 2024 +0800

    s390: avoid peeking eof after __vector
    
    Same like PR101168, it is need for s390 to
    avoid peeking eof after vector keyword.
    And similar test case is also ok for s390.
    
            PR target/95782
    
    gcc/ChangeLog:
    
            * config/s390/s390-c.cc (s390_macro_to_expand): Avoid empty identifier.
    
    gcc/testsuite/ChangeLog:
    
            * g++.target/s390/pr95782.C: New test.

Diff:
---
 gcc/config/s390/s390-c.cc               | 4 +++-
 gcc/testsuite/g++.target/s390/pr95782.C | 5 +++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/config/s390/s390-c.cc b/gcc/config/s390/s390-c.cc
index 1bb6e810766..4521a86f048 100644
--- a/gcc/config/s390/s390-c.cc
+++ b/gcc/config/s390/s390-c.cc
@@ -275,7 +275,9 @@ s390_macro_to_expand (cpp_reader *pfile, const cpp_token *tok)
       /* __vector long __bool a; */
       if (ident == C_CPP_HASHNODE (__bool_keyword))
 	expand_bool_p = true;
-      else
+
+      /* If there are more tokens to check.  */
+      else if (ident)
 	{
 	  /* Triggered with: __vector long long __bool a; */
 	  do
diff --git a/gcc/testsuite/g++.target/s390/pr95782.C b/gcc/testsuite/g++.target/s390/pr95782.C
new file mode 100644
index 00000000000..daf887fc6fe
--- /dev/null
+++ b/gcc/testsuite/g++.target/s390/pr95782.C
@@ -0,0 +1,5 @@
+// { dg-do compile }
+// { dg-options "-march=z14 -mzvector" }
+
+using vdbl =  __vector double;
+#define BREAK 1

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

only message in thread, other threads:[~2024-04-28  3:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-28  3:39 [gcc r15-14] s390: avoid peeking eof after __vector Jiu Fu Guo

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