This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

optimization/7632: gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments


>Number:         7632
>Category:       optimization
>Synopsis:       gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 19 04:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Horst Lehser
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
the following C source will generate incorrect code

double a;
double foo(void)
{
	((int *)&a)[1] += 5;
	return;
}
Generated assembler
foo:
        lis %r3,a+4@ha
        lis %r5,a@ha
        lwz %r4,a+4@l(%r3)
        lfd %f1,a@l(%r5)	/* a not modified yet */
        addi %r0,%r4,10
        stw %r0,a+4@l(%r3)
        blr
	

>How-To-Repeat:
compile the following code with
gcc -O3 -S

double a;
double foo(void)
{
	((int *)&a)[1] += 10;
	return a;
}
>Fix:

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]