From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26786 invoked by alias); 22 Mar 2003 08:16: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 26771 invoked by uid 71); 22 Mar 2003 08:16:00 -0000 Date: Sat, 22 Mar 2003 08:16:00 -0000 Message-ID: <20030322081600.26770.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Glen Nakamura Subject: Re: optimization/10185: [3.3/3.4 regression] Wrong code with 3-int-structs & optimization Reply-To: Glen Nakamura X-SW-Source: 2003-03/txt/msg01462.txt.bz2 List-Id: The following reply was made to PR optimization/10185; it has been noted by GNATS. From: Glen Nakamura To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, rassahah@neofonie.de Cc: Subject: Re: optimization/10185: [3.3/3.4 regression] Wrong code with 3-int-structs & optimization Date: Fri, 21 Mar 2003 22:13:39 -1000 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10185 Aloha, This bug has similar symptoms to PR opt/10087. The gcse pass generates the following code (notice insn 106 is redundant to insn 103): (insn 22 88 103 3 0x4014b764 (parallel [ (set (reg/s:SI 65) (plus:SI (reg:SI 79) (const_int -1 [0xffffffff]))) (clobber (reg:CC 17 flags)) ]) 146 {*addsi_1} (nil) (nil)) (insn 103 22 23 3 (nil) (set (reg:SI 79) (reg/s:SI 65)) 38 {*movsi_1} (nil) (nil)) (insn 23 103 106 3 0x4014b764 (set (mem/f:SI (plus:SI (reg/f:SI 20 frame) (const_int -4 [0xfffffffc])) [5 S4 A32]) (reg/s:SI 65)) 38 {*movsi_1} (nil) (expr_list:REG_EQUAL (plus:SI (reg:SI 67) (const_int -1 [0xffffffff])) (nil))) (insn 106 23 25 3 (nil) (set (reg:SI 79) (reg/s:SI 65)) 38 {*movsi_1} (nil) (nil)) The loop pass then considers insn 103 and insn 106 as places where biv 79 is incremented. This is incorrect since insn 106 sets reg 76 to the same value as insn 103. Now during strength reduction, the giv is incremented after insn 103 and insn 106 resulting in a delta that is twice the correct value. This test case passes with the patch from: http://gcc.gnu.org/ml/gcc-patches/2003-03/msg01932.html - glen