From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id B2A013853540 for ; Wed, 8 Jun 2022 04:47:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B2A013853540 Received: by mail-oi1-x232.google.com with SMTP id i66so26623013oia.11 for ; Tue, 07 Jun 2022 21:47:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=cLnP/7V8rdQykWkAlxAcBeUDzpiHrCPakeplHe9mVps=; b=cKGEYb0hwThwuN6KWSDAtKi3u9MXzeJIc76DLtxtWYttcOcjxKf+6Hmj6ZNMQ0xY4/ u2jb2+eFiDeuGhvsz5EDa9h2ohebvA8prvhwO+TNFzVgFCW9w7SXJEqNWLDpDeMPEZ+l 2vZhscbZnDtA7NZYbdMU3RpTxRYv07CdLzInCuxVwiTDkuYwN0r/R4WZNgN4s+pX1m3T cOogQC47A1RwIJ9tMo6aHTTNAh/vXU4dHxUCwZ5Ik21cYzOZL41MrCWWqxHJq1r4ZfUV 76zz1JzowhDyxVlchFVY1KXMoDxcK46OQYXCYrIqoKPOvtE1sLkg+hGs4xQjlRTsG4FX lZew== X-Gm-Message-State: AOAM5326rH01dCp3EvSpYL+0aHaIOhnH3y3QlDIeVZzlRte9nKVKjVvT iIHeasOe9jDFgvtXj21QStaXtloFGmK+fu2biPpnPzOnKOI= X-Google-Smtp-Source: ABdhPJw7uJmudw5mE6HPpXPrPQXwwTSTT0LoJEZuAF4ys1aCTWzH6ZF878W/lS/Jz5GToRfurBe+B2vNwWpTYbFQsRA= X-Received: by 2002:a05:6808:20a0:b0:32b:5a62:def9 with SMTP id s32-20020a05680820a000b0032b5a62def9mr1339107oiw.250.1654663647662; Tue, 07 Jun 2022 21:47:27 -0700 (PDT) MIME-Version: 1.0 From: Zopolis0 Date: Wed, 8 Jun 2022 14:47:14 +1000 Message-ID: Subject: Incorrect replacement of TYPE_METHODS with TYPE_FIELDS causing segfault. To: gcc-help X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2022 04:47:30 -0000 While compiling gcj on my mstermerge branch ( https://github.com/Zopolis4/gcj/tree/mstermerge) it breaks on, amongst other things, an internal compiler error: echo ../../../../gcj/libjava/classpath/lib/java/lang/ref/*.class > java/lang/ref.list echo ../../../../gcj/libjava/classpath/lib/java/lang/reflect/*.class > java/lang/reflect.list In file included from :31: ../../../../gcj/libjava/java/lang/Object.java: internal compiler error: tree check: expected function_decl, have field_decl in layout_class_method, at java/class.cc:2627 In file included from :63: java/lang/Object.java: internal compiler error: tree check: expected function_decl, have field_decl in layout_class_method, at java/class.cc:2627 I believe that this error is due to the following incorrect code at line 2589 at gcc/java/class.cc: 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 ( https://github.com/Zopolis4/gcj/commit/1f38bc896a704290ca0b742c60c60a88d5e1fb07#diff-bf49cdc948b20b9f25afd3fbb36922a10e979a55ff9600b3b51d0ec54175b752L2592) 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/class.cc wrong?