This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/49211] MMIX: Code generation broken, when using global variables
- From: "nils at script-solution dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 May 2011 14:47:45 +0000
- Subject: [Bug target/49211] MMIX: Code generation broken, when using global variables
- Auto-submitted: auto-generated
- References: <bug-49211-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49211
--- Comment #3 from Nils Asmussen <nils@script-solution.de> 2011-05-30 14:47:40 UTC ---
Thanks for your reply!
Perhaps I miss something, but I've no idea how that should work. Regardless of
whether $254 is initialized previously or not (in my case, it's a bootloader,
so there is no stdlib and no crt*, but I have to do that myself), using the
stack-pointer to access global variables can't work, right? Lets suppose, that
the offset in main is correct. That would mean, that x is located at $254 + 8.
But $254 is changed (of course) at the beginning and end of a function (and
nowhere else). If func2 accesses x as well, gcc generates code to access it at
$254 + 8. So, it expects it to be always at offset 8 from $254, but of course
that can't work, because $254 changes.