public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pietro.braione at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/115589] New: (aarch64) clobbered register variables Date: Sat, 22 Jun 2024 12:50:56 +0000 [thread overview] Message-ID: <bug-115589-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115589 Bug ID: 115589 Summary: (aarch64) clobbered register variables Product: gcc Version: 11.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: pietro.braione at gmail dot com Target Milestone: --- /* * compiled with gcc -O0, on my platform (Ubuntu 22.04 aarch64) prints: * * 4 * 2 * * This is a very simplified example. In my production code I have * variables that are assigned register x21-x23, and gcc generates * code that uses these registers as temporaries without saving * elsewhere the content of the variables, that are lost. */ #include <stdio.h> int a = 1, b = 1, c = 1, d = 1; void main() { register int x asm("x0"); x = 0; printf("%d\n", a + b + c + d); printf("%d\n", x); }
next reply other threads:[~2024-06-22 12:50 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-06-22 12:50 pietro.braione at gmail dot com [this message] 2024-06-22 14:11 ` [Bug target/115589] " pinskia at gcc dot gnu.org 2024-06-22 14:14 ` pinskia at gcc dot gnu.org 2024-06-22 14:15 ` pinskia at gcc dot gnu.org 2024-06-22 15:26 ` pietro.braione at gmail dot com
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-115589-4@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).