From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10451 invoked by alias); 19 Aug 2002 13:36:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10437 invoked by uid 71); 19 Aug 2002 13:36:02 -0000 Date: Mon, 19 Aug 2002 08:56:00 -0000 Message-ID: <20020819133602.10436.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Daniel Jacobowitz Subject: Re: optimization/7632: gcc 3.2 for PowerPC: instruction scheduling ignores dependency in variable asignments Reply-To: Daniel Jacobowitz X-SW-Source: 2002-08/txt/msg00380.txt.bz2 List-Id: The following reply was made to PR optimization/7632; it has been noted by GNATS. From: Daniel Jacobowitz 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