From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9048 invoked by alias); 21 Sep 2004 01:56:40 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 9029 invoked by uid 48); 21 Sep 2004 01:56:39 -0000 Date: Tue, 21 Sep 2004 01:56:00 -0000 From: "danglin at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040921015638.17578.danglin@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/17578] New: Missed optimization--failure of gcc.c-torture/execute/ieee/compare-fp-3.c at -O1 and above X-Bugzilla-Reason: CC X-SW-Source: 2004-09/txt/msg02337.txt.bz2 List-Id: FAIL: gcc.c-torture/execute/ieee/compare-fp-3.c compilation, -O1 UNRESOLVED: gcc.c-torture/execute/ieee/compare-fp-3.c execution, -O1 FAIL: gcc.c-torture/execute/ieee/compare-fp-3.c compilation, -O2 UNRESOLVED: gcc.c-torture/execute/ieee/compare-fp-3.c execution, -O2 FAIL: gcc.c-torture/execute/ieee/compare-fp-3.c compilation, -O3 -fomit-frame- pointer UNRESOLVED: gcc.c-torture/execute/ieee/compare-fp-3.c execution, -O3 -fomit- frame-pointer FAIL: gcc.c-torture/execute/ieee/compare-fp-3.c compilation, -O3 -g UNRESOLVED: gcc.c-torture/execute/ieee/compare-fp-3.c execution, -O3 -g FAIL: gcc.c-torture/execute/ieee/compare-fp-3.c compilation, -Os UNRESOLVED: gcc.c-torture/execute/ieee/compare-fp-3.c execution, -Os /tmp/ccKC9FUM.o(.text+0x30): In function `test1': : undefined reference to `link_error0' collect2: ld returned 1 exit status The failures first appeared with the following change: 2004-09-02 James E Wilson * common.opt (ftrapping-math): Default to on. The tests don't fail with -fno-trapping-math. This is the function that doesn't optimize: void test1 (float x, float y) { if ((x==y) && (x!=y)) link_error0(); } It is the only pair of comparisons in this test that isn't correctly optimized. The others are correctly optimized prior to the initial RTL generation. The generated code for this function is ok. It's just not optimized. As far as I can tell, neither comparison should trap, so -ftrapping-math shouldn't affect the optimization. This is the generated code at -O1. .text .align 4 .globl test1 .type test1, @function test1: .PROC .CALLINFO FRAME=64,CALLS,SAVE_RP .ENTRY stw %r2,-20(%r30) fcmp,sgl,!= %fr4L,%fr5L ftest b .L4 ldo 64(%r30),%r30 b .L7 ldw -84(%r30),%r2 .L4: fcmp,sgl,= %fr4L,%fr5L ftest b .L6 ldw -84(%r30),%r2 b,n .L7 .L6: bl link_error0,%r2 nop ldw -84(%r30),%r2 .L7: bv %r0(%r2) ldo -64(%r30),%r30 .EXIT .PROCEND .size test1, .-test1 This doesn't appear to be a regression as 3.4 doesn't optimize this function either. I've added Roger and Paolo to the cc list as they worked on this optimization. -- Summary: Missed optimization--failure of gcc.c- torture/execute/ieee/compare-fp-3.c at -O1 and above Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: danglin at gcc dot gnu dot org CC: bonzini at gnu dot org,gcc-bugs at gcc dot gnu dot org,roger at eyesopen dot com GCC build triplet: hppa-unknown-linux-gnu GCC host triplet: hppa-unknown-linux-gnu GCC target triplet: hppa-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17578