[Bug target/126712] MIPS NewABI GP setup with local function aliases

"ibuclaw at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126712

Iain Buclaw <ibuclaw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at gcc dot gnu.org

--- Comment #3 from Iain Buclaw <ibuclaw at gcc dot gnu.org> ---
If you want to test equivalent C program, created one here.


https://compiler-explorer.com/z/dMWMYv75n


---

int counter;
int never;

__attribute__((weak)) int firstFunction(int) __asm__("__start");
int firstFunction(int value)
{
    counter += value;
    return counter;
}

__attribute__((weak)) int secondFunction(int);
int secondFunction(int value)
{
    counter += value;
    return counter;
}

__attribute__((nothrow)) int callLocal(int);
int callLocal(int value)
{
    if (never)
        return firstFunction(value);

    return secondFunction(value);
}

int main(void)
{
    return callLocal(1) != 1;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.