public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Lulu Cheng <chenglulu@loongson.cn>, gcc-patches@gcc.gnu.org
Cc: i@xen0n.name, xuchenghua@loongson.cn
Subject: Re: [PATCH v1 1/2] LoongArch: Switch loongarch-def from C to C++ to make it possible.
Date: Sat, 02 Dec 2023 18:15:32 +0800	[thread overview]
Message-ID: <d0e094dad5b45901c2605fdaa9efe8de864b5381.camel@xry111.site> (raw)
In-Reply-To: <20231202081441.4799-2-chenglulu@loongson.cn>

On Sat, 2023-12-02 at 16:14 +0800, Lulu Cheng wrote:

/* snip */

> diff --git a/gcc/config/loongarch/loongarch-opts.cc
> b/gcc/config/loongarch/loongarch-opts.cc
> index b5836f198c0..6861642a98d 100644
> --- a/gcc/config/loongarch/loongarch-opts.cc
> +++ b/gcc/config/loongarch/loongarch-opts.cc
> @@ -163,6 +163,7 @@ loongarch_config_target (struct loongarch_target
> *target,
>  			 int follow_multilib_list_p)
>  {
>    struct loongarch_target t;
> +
>    if (!target)
>      return;
>  
> @@ -657,12 +658,18 @@ abi_str (struct loongarch_abi abi)
>  		     strlen (loongarch_abi_base_strings[abi.base]));
>    else
>      {
> +      /* This situation has not yet occurred, so in order to avoid
> the
> +	 -Warray-bounds warning during C++ syntax checking, this part
> +	 of the code is commented first.*/
> +      /*

Just put a "gcc_unreachable ();" here?

>        APPEND_STRING (loongarch_abi_base_strings[abi.base])
>        APPEND1 ('/')
>        APPEND_STRING (loongarch_abi_ext_strings[abi.ext])
>        APPEND1 ('\0')
>  
>        return XOBFINISH (&msg_obstack, const char *);
> +      */
> +      gcc_unreachable ();
>      }
>  }
>  
> diff --git a/gcc/config/loongarch/loongarch-opts.h
> b/gcc/config/loongarch/loongarch-opts.h
> index fa3773223bc..7a644c86d48 100644
> --- a/gcc/config/loongarch/loongarch-opts.h
> +++ b/gcc/config/loongarch/loongarch-opts.h
> @@ -21,7 +21,10 @@ along with GCC; see the file COPYING3.  If not see
>  #ifndef LOONGARCH_OPTS_H
>  #define LOONGARCH_OPTS_H
>  
> +/* This is a C++ header and it shouldn't be used by target libraries.  */
> +#if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
>  #include "loongarch-def.h"
> +#endif

With this change we can revert r14-5634 (remove the #if
!defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
guards in loongarch-def.h as they'll be unneeded).


-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2023-12-02 10:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-02  8:14 [PATCH v1 0/2] Delete ISA_BASE_LA64V110 related definitions Lulu Cheng
2023-12-02  8:14 ` [PATCH v1 1/2] LoongArch: Switch loongarch-def from C to C++ to make it possible Lulu Cheng
2023-12-02 10:15   ` Xi Ruoyao [this message]
2023-12-02 12:44     ` chenglulu
2023-12-02 13:41       ` Xi Ruoyao
2023-12-05  2:28         ` chenglulu
2023-12-02  8:14 ` [PATCH v1 2/2] LoongArch: Remove the definition of ISA_BASE_LA64V110 from the code Lulu Cheng

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=d0e094dad5b45901c2605fdaa9efe8de864b5381.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@xen0n.name \
    --cc=xuchenghua@loongson.cn \
    /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).