target/4033: Illegal assembly generated on ppc64

Zoltan Hidvegi hzoli@austin.ibm.com
Wed Aug 15 14:39:00 GMT 2001


>Number:         4033
>Category:       target
>Synopsis:       Illegal assembly generated on ppc64
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 15 10:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Zoltan Hidvegi
>Release:        3.0.1 20010725 (prerelease)
>Organization:
>Environment:
System: AIX vlad 3 4 0005BA2F4C00


	
host: powerpc-ibm-aix4.3.3.0
build: powerpc-ibm-aix4.3.3.0
target: powerpc-ibm-aix4.3.3.0
configured with: ../gcc/configure --prefix=... --with-local-prefix=... --enable-languages=c,c++,java --enable-version-specific-runtime-libs --disable-nls --disable-shared
>Description:
The function

int
load_p_plus_2(char *p)
{
    return *(int*)(p+2);
}

when compiled with -O2 -maix64 generates

        lwa 3,2(3)

This is illegal, only displacements that are multiple of 4 are
allowed.  The IBM compiler generates

        lwz     r0,2(r3)
        extsw   r3,r0

>How-To-Repeat:

Run gcc -O2 -maix64 -c bug64.c

--------- BEGIN bug64.c -----------
int
load_p_plus_2(char *p)
{
    return *(int*)(p+2);
}
---------- END bug64.c ------------

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list