From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2360 invoked by alias); 21 Sep 2004 04:33:16 -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 2348 invoked by uid 48); 21 Sep 2004 04:33:15 -0000 Date: Tue, 21 Sep 2004 04:33:00 -0000 Message-ID: <20040921043315.2347.qmail@sourceware.org> From: "danglin at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040921015638.17578.danglin@gcc.gnu.org> References: <20040921015638.17578.danglin@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/17578] 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/msg02346.txt.bz2 List-Id: ------- Additional Comments From danglin at gcc dot gnu dot org 2004-09-21 04:33 ------- > 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. I take this back. The compares can trap if x or y is a signalling NaN. Thus, the compares can't be optimized without -fno-trapping-math. I see gcc.c-torture/execute/ieee/compare-fp-3.x tries to set -fno-trapping-math but it doesn't work. For example, Executing on host: /home/dave/gnu/gcc-4.0/objdir/gcc/xgcc -B/home/dave/gnu/gcc-4 .0/objdir/gcc/ /home/dave/gnu/gcc-4.0/gcc/gcc/testsuite/gcc.c-torture/execute/ie ee/compare-fp-3.c -w -O1 -ffloat-store -lm -o /home/dave/gnu/gcc-4.0/objdi r/gcc/testsuite/compare-fp-3.x1 (timeout = 300) PASS: gcc.c-torture/execute/ieee/compare-fp-3.c compilation, -O1 PASS: gcc.c-torture/execute/ieee/compare-fp-3.c execution, -O1 On x86, link_error0 get optimized away in the compare-fp-3.c.16.life pass. There seems to be a bunch of bugs here. We have link_error0 being optimized away in test2 and test3 during tree optimization when -fno-trapping-math is not set. link_error0 is also being optimized away in the life pass on x86 with -fno-trapping-math not set. The test isn't using the -fno-trapping-math. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17578