public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc at breakpoint dot cc" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/44606]  New: Wrong SPE floating point during computation
Date: Mon, 21 Jun 2010 09:09:00 -0000	[thread overview]
Message-ID: <bug-44606-14399@http.gcc.gnu.org/bugzilla/> (raw)

I attached two testcase which is stripped down graphicsmagick code.
tc-resize2.c has a few instructions more than tc-resize.c. I belive the bug is 
the same.
 gcc -o tc2 -O0 -Wall -Wextra tc-resize.c
 gcc -o tc2 -O2 -Wall -Wextra tc-resize.c
 ( ./tc0 ; echo "-"; ./tc2 )
 .19 2484.000000
 .21 2700.000000
 .23 2916.000000
 .24 3132.000000
 .26 3348.000000
 -
 .0 2484.000000
 .0 2700.000000
 .0 2916.000000
 .0 3132.000000
 .0 3348.000000

 gcc -o tc20 -O0 -Wall -Wextra tc-resize2.c
 gcc -o tc22 -O2 -Wall -Wextra tc-resize2.c
 ( ./tc20 ; echo "-"; ./tc22 )
 .26 3264.000000
 .28 3520.000000
 .30 3776.000000
 .32 4032.000000
 .34 4288.000000
 -
 .14 1734.000000
 .15 1870.000000
 .16 2006.000000
 .17 2142.000000
 .18 2278.000000

 Now here is stripped down output of the assembly file:

 MinifyImage:
         evstdd 26,88(11)
 .L9:
         li 26,0

         stw 26,64(1)
 .L11:
  #APP
  # 105 "tc-resize.c" 1
         nop
  # 0 "" 2
 #NO_APP
         lis 19,.LC5@ha
         efdmul 5,9,26           r26 should be 0.0078125 but is 0
                                 r26 bits 32..63 are, dunno about 0..31    
         la 19,.LC5@l(19)
         evldd 19,0(19)          r19 is 0.5
         efdadd 5,5,19           r5 is expected to be .5
         efdctuiz 5,5            r5 is 0
         rlwinm 5,5,0,0xff

 #APP
  # 107 "tc-resize.c" 1
         nop
  # 0 "" 2
 #NO_APP
         evmergehi 6,9,9
         mr 7,9
         mr 8,7
         mr 7,6

         crxor 6,6,6     that should be 9,9,9 but is a different issue :)
         bl fprintf      # r5 int (bad), r6 pad, r7 & r8 double

r26 is zero and that is wrong. I belive 1/128.0 gets replaced by 0.0 and
optimized.

Sebastian


-- 
           Summary: Wrong SPE floating point during computation
           Product: gcc
           Version: 4.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at breakpoint dot cc
 GCC build triplet: powerpc-linux-gnuspe
  GCC host triplet: powerpc-linux-gnuspe
GCC target triplet: powerpc-linux-gnuspe


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44606


             reply	other threads:[~2010-06-21  9:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21  9:09 gcc at breakpoint dot cc [this message]
2010-06-21  9:10 ` [Bug tree-optimization/44606] " gcc at breakpoint dot cc
2010-06-21  9:11 ` gcc at breakpoint dot cc
2010-06-21  9:11 ` gcc at breakpoint dot cc
2010-07-16 18:48 ` [Bug target/44606] " Kyle dot D dot Moffett at boeing dot com
2010-08-31 14:04 ` Kyle dot D dot Moffett at boeing dot com
2010-08-31 14:04 ` Kyle dot D dot Moffett at boeing dot com
2010-09-09 15:29 ` froydnj at gcc dot gnu dot org
2010-09-11 15:06 ` kyle at moffetthome dot net
2010-09-22 18:50 ` wd at denx dot de

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=bug-44606-14399@http.gcc.gnu.org/bugzilla/ \
    --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).