This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/17578] New: Missed optimization--failure of gcc.c-torture/execute/ieee/compare-fp-3.c at -O1 and above


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]