From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4148 invoked by alias); 4 Feb 2015 11:45:25 -0000 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 Received: (qmail 4062 invoked by uid 48); 4 Feb 2015 11:45:21 -0000 From: "ebotcazou at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/62631] gcc.dg/tree-ssa/ivopts-lt-2.c FAILs Date: Wed, 04 Feb 2015 11:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ebotcazou at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg00307.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62631 --- Comment #16 from Eric Botcazou --- > The cost of expression "p + ((sizetype)(99 - i_6(D)) + 1) * 4" computed > using normal +/-/* operators on sparc64 is 18, but the cost is 32 if it is > computed as "p + ((sizetype)(99 - i_6(D)) + 1) << 2", which is returned by > get_shiftadd_cost. How do you get the first number exactly? Note that the costs of shiftadd is completely skewed (by a factor of 3) because expmed.c computes it as a multadd instead of a shiftadd: Breakpoint 2, init_expmed_one_mode (all=0x7fffffffd540, mode=QImode, speed=1) at /home/eric/svn/gcc/gcc/expmed.c:219 219 set_shiftadd_cost (speed, mode, m, set_src_cost (all->shift_add, speed)); (gdb) p debug_rtx(all->shift_add) (plus:QI (mult:QI (reg:QI 109 [0]) (const_int 2 [0x2])) (reg:QI 109 [0])) but this should ensure that the costs are roughly the same for the expressions. > From the assembly code, it seems the computation is expensive on sparc64, I > may skip the test for these architectures if no other solutions. The hitch is that the code generated for 32-bit SPARC (where the test passes) is the optimal one and is also valid for 64-bit SPARC.