public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/7632: gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments
@ 2002-09-11 12:06 dje
0 siblings, 0 replies; 4+ messages in thread
From: dje @ 2002-09-11 12:06 UTC (permalink / raw)
To: Horst.Lehser, dje, gcc-bugs, gcc-prs, nobody
Synopsis: gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments
Responsible-Changed-From-To: unassigned->dje
Responsible-Changed-By: dje
Responsible-Changed-When: Wed Sep 11 12:06:03 2002
Responsible-Changed-Why:
PowerPC
State-Changed-From-To: open->closed
State-Changed-By: dje
State-Changed-When: Wed Sep 11 12:06:03 2002
State-Changed-Why:
The source code example violates ISO C aliasing rules due to cast. Either compile with -fno-strict-aliasing or correct the code as described in GCC documentation (e.g., union).
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7632
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: optimization/7632: gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments
@ 2002-08-19 8:56 Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2002-08-19 8:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR optimization/7632; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@mvista.com>
To: Horst.Lehser@hightec-rt.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/7632: gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments
Date: Mon, 19 Aug 2002 09:33:59 -0400
On Mon, Aug 19, 2002 at 11:49:16AM -0000, Horst.Lehser@hightec-rt.com wrote:
>
> >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
(I assume you meant "return a" above).
You may want to read the documentation for -fno-strict-aliasing; your
code is illegal C. With -fno-strict-aliasing I get the expected
result.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: optimization/7632: gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments
@ 2002-08-19 5:36 Andrew Pinski
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Pinski @ 2002-08-19 5:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR optimization/7632; it has been noted by GNATS.
From: Andrew Pinski <pinskia@physics.uc.edu>
To: Horst.Lehser@hightec-rt.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/7632: gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments
Date: Mon, 19 Aug 2002 08:22:57 -0400
It is an invalid use of pointers conversion of ISO C aka aliasing rules.
Thanks,
Andrew Pinski
On Monday, August 19, 2002, at 07:49 , Horst.Lehser@hightec-
rt.com wrote:
> double a;
> double foo(void)
> {
> ((int *)&a)[1] += 5;
> return;
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
* optimization/7632: gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments
@ 2002-08-19 5:26 Horst.Lehser
0 siblings, 0 replies; 4+ messages in thread
From: Horst.Lehser @ 2002-08-19 5:26 UTC (permalink / raw)
To: gcc-gnats
>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:
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-09-11 19:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-11 12:06 optimization/7632: gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments dje
-- strict thread matches above, loose matches on Subject: below --
2002-08-19 8:56 Daniel Jacobowitz
2002-08-19 5:36 Andrew Pinski
2002-08-19 5:26 Horst.Lehser
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).