public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/17578] New: Missed optimization--failure of gcc.c-torture/execute/ieee/compare-fp-3.c at -O1 and above
@ 2004-09-21  1:56 danglin at gcc dot gnu dot org
  2004-09-21  4:33 ` [Bug tree-optimization/17578] " danglin at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: danglin at gcc dot gnu dot org @ 2004-09-21  1:56 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-01-15  5:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-21  1:56 [Bug tree-optimization/17578] New: Missed optimization--failure of gcc.c-torture/execute/ieee/compare-fp-3.c at -O1 and above danglin at gcc dot gnu dot org
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

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).