public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "danglin at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@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
Date: Tue, 21 Sep 2004 01:56:00 -0000	[thread overview]
Message-ID: <20040921015638.17578.danglin@gcc.gnu.org> (raw)

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  <wilson@specifixinc.com>

        * 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


             reply	other threads:[~2004-09-21  1:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-21  1:56 danglin at gcc dot gnu dot org [this message]
2004-09-21  4:33 ` [Bug tree-optimization/17578] " danglin at gcc dot gnu dot org
2004-09-21  4:35 ` pinskia at gcc dot gnu dot org
2004-09-21  6:20 ` dave at hiauly1 dot hia dot nrc dot ca
2004-09-23  3:18 ` danglin at gcc dot gnu dot org
2004-12-23  2:11 ` pinskia at gcc dot gnu dot org
2004-12-26 20:49 ` cvs-commit at gcc dot gnu dot org
2004-12-26 21:00 ` danglin at gcc dot gnu dot org
2005-01-07 14:15 ` pinskia at gcc dot gnu dot org
2005-01-15  5:26 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040921015638.17578.danglin@gcc.gnu.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).