public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/115589] New: (aarch64) clobbered register variables
@ 2024-06-22 12:50 pietro.braione at gmail dot com
  2024-06-22 14:11 ` [Bug target/115589] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pietro.braione at gmail dot com @ 2024-06-22 12:50 UTC (permalink / raw)
  To: gcc-bugs

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);
}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-06-22 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-22 12:50 [Bug c/115589] New: (aarch64) clobbered register variables pietro.braione at gmail dot com
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

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