From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16581 invoked by alias); 10 May 2003 16:36:01 -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 16541 invoked by uid 71); 10 May 2003 16:36:00 -0000 Date: Sat, 10 May 2003 16:36:00 -0000 Message-ID: <20030510163600.16540.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Marcus Comstedt Subject: Re: optimization/8867: [sh] wrong code: double use of register Reply-To: Marcus Comstedt X-SW-Source: 2003-05/txt/msg00970.txt.bz2 List-Id: The following reply was made to PR optimization/8867; it has been noted by GNATS. From: Marcus Comstedt To: Dara Hazeghi Cc: gcc-gnats@gcc.gnu.org Subject: Re: optimization/8867: [sh] wrong code: double use of register Date: 10 May 2003 18:29:43 +0200 Dara Hazeghi writes: > code generated by 3.3: [...] > .L5: > mov #64,r1 > add r14,r1 > mov.l @(0,r1),r2 > mov.l @(12,r1),r1 ! > add r1,r2 > mov #64,r1 * > add r14,r1 * > mov.l r2,@(0,r1) [...] This looks ok. The offset in r1 is recomputed by the instructions I marked with * to compensate for the fact that the instruction marked ! overwrites r1. > Code generated by 3.4: [...] > .L4: > add r10,r11 [...] Here, gcc has made a completely different (probably much better) register allocation, so both x and l7 are allocated to registers. Since the stack accesses are gone, there is no way to tell whether the actual bug is still there or not, but the generated code looks ok at any rate. // Marcus