From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26195 invoked by alias); 9 Jul 2010 22:11:49 -0000 Received: (qmail 26157 invoked by uid 48); 9 Jul 2010 22:11:34 -0000 Date: Fri, 09 Jul 2010 22:11:00 -0000 Message-ID: <20100709221134.26156.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/44883] Combine separate shift and add instructions into a single one In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "carrot at google dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg01085.txt.bz2 ------- Comment #4 from carrot at google dot com 2010-07-09 22:11 ------- Consider following case: add r3, r1, r2 ldr r4, [r3] Suppose there is no other usage of r3, propagate the first instruction into the second and remove the first is the correct behavior and beneficial. This is also the current cost model's behavior. So I was really confused by the function name arm_arm_address_cost. Suppose there is another usage of r3 in later instructions, even we propagate the first instruction into the second instruction, we can't delete the first one. So there is no beneficial with the propagation and we should stop. My original test case is very similar. The (reg 137) is used more than once, the propagation can't make insn 15 dead, so the result is not better. On the contrary it prevents other optimization (combine of insn 13 and insn 15). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44883