public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059 Date: Sun, 28 Apr 2024 14:35:20 +0000 [thread overview] Message-ID: <bug-105522-4-whGiijYABD@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105522-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105522 --- Comment #19 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>: https://gcc.gnu.org/g:a1b0ace9737a40957bfb298de22066d8ee9a6603 commit r11-11385-ga1b0ace9737a40957bfb298de22066d8ee9a6603 Author: Iain Sandoe <iain@sandoe.co.uk> Date: Sat Jan 6 10:52:38 2024 +0000 Darwin: Fix constant CFString code-gen [PR105522]. Although this only fires for one of the Darwin sub-ports, it is latent elsewhere, it is also a regression c.f. the Darwin system compiler. In the code we imported from an earlier branch, CFString objects (which are constant aggregates) are constructed as CONST_DECLs. Although our current documentation suggests that these are reserved for enumeration values, in fact they are used elsewhere in the compiler for constants. This includes Objective-C where they are used to form NSString constants. In the particular case, we take the address of the constant and that triggers varasm.cc:decode_addr_constant, which does not currently support CONST_DECL. If there is a general intent to allow/encourage wider use of CONST_DECL, then we should fix decode_addr_constant to look through these and evaluate the initializer (a two-line patch, but I'm not suggesting it for stage-4). We also need to update the GCC internals documentation to allow for the additional uses. This patch is Darwin-local and fixes the problem by making the CFString constants into regular variable but TREE_CONSTANT+TREE_READONLY. I plan to back-port this to the open branches once it has baked a while on trunk. Since, for Darwin, the Objective-C default is to construct constant NSString objects as CFStrings; this will also cover the majority of cases there (this patch does not make any changes to Objective-C NSStrings). PR target/105522 gcc/ChangeLog: * config/darwin.c (machopic_select_section): Handle C and C++ CFStrings. (darwin_rename_builtins): Move this out of the CFString code. (darwin_libc_has_function): Likewise. (darwin_build_constant_cfstring): Create an anonymous var to hold each CFString. * config/darwin.h (ASM_OUTPUT_LABELREF): Handle constant CFstrings. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> (cherry picked from commit aecc0d4ba73d0810334b351da1e67232cea450d3)
next prev parent reply other threads:[~2024-04-28 14:35 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-08 6:10 [Bug target/105522] New: gcc11: internal compiler error: " vital.had at gmail dot com 2022-05-08 7:54 ` [Bug target/105522] " iains at gcc dot gnu.org 2022-05-08 8:08 ` vital.had at gmail dot com 2022-05-08 8:09 ` vital.had at gmail dot com 2022-05-08 9:05 ` iains at gcc dot gnu.org 2022-05-08 9:31 ` vital.had at gmail dot com 2022-05-08 14:31 ` [Bug target/105522] [powerpc-darwin] ICE: " iains at gcc dot gnu.org 2022-05-08 16:11 ` vital.had at gmail dot com 2022-11-01 0:36 ` vital.had at gmail dot com 2023-07-17 10:33 ` vital.had at gmail dot com 2024-01-18 13:55 ` cvs-commit at gcc dot gnu.org 2024-01-18 14:34 ` vital.had at gmail dot com 2024-03-03 21:13 ` bergner at gcc dot gnu.org 2024-03-03 22:00 ` iains at gcc dot gnu.org 2024-03-18 12:53 ` vital.had at gmail dot com 2024-03-18 12:55 ` vital.had at gmail dot com 2024-03-18 16:09 ` iains at gcc dot gnu.org 2024-03-31 12:47 ` cvs-commit at gcc dot gnu.org 2024-04-19 13:14 ` cvs-commit at gcc dot gnu.org 2024-04-28 14:35 ` cvs-commit at gcc dot gnu.org [this message] 2024-04-28 14:46 ` iains at gcc dot gnu.org
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=bug-105522-4-whGiijYABD@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe 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).