public inbox for
 help / color / mirror / Atom feed
From: Xi Ruoyao <>
To: Zopolis0 <>, gcc-help <>
Subject: Re: Incorrect replacement of TYPE_METHODS with TYPE_FIELDS causing segfault.
Date: Wed, 08 Jun 2022 15:02:16 +0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Wed, 2022-06-08 at 14:47 +1000, Zopolis0 via Gcc-help wrote:

/* snip */

> java/lang/ internal compiler error: tree check: expected
> function_decl, have field_decl in layout_class_method, at java/
> I believe that this error is due to the following incorrect code at line
> 2589 at gcc/java/
>   for (tree method_decl = TYPE_FIELDS (this_class);
> Before it was removed, this line was:
>   for (method_decl = TYPE_METHODS (this_class);
> But I have since modified it (
> in accordance with 5aaa8fb40681ee66282d73dab8c8eccbf5ee0518
> Given that this was incorrect, what would be the correct way to replace
> this instance of TYPE_METHODS? Were all my replacements of TYPE_METHODS in
> gcc/java/ wrong?

5aaa8fb is not a simple replacement.  For example:

   /* If there are user-defined methods, they are deemed non-trivial.  */
-  for (tmp = TYPE_METHODS (type); tmp; tmp = TREE_CHAIN (tmp))
-    if (!DECL_ARTIFICIAL (tmp))
+  for (tree fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))
       return true;

I think you need to check if the field is really a method like this.
Xi Ruoyao <>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2022-06-08  7:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08  4:47 Zopolis0
2022-06-08  7:02 ` Xi Ruoyao [this message]
2022-06-08  8:13   ` Zopolis0

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:

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

  git send-email \ \ \ \ \

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