public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/44606]  New: Wrong SPE floating point during computation
@ 2010-06-21  9:09 gcc at breakpoint dot cc
  2010-06-21  9:10 ` [Bug tree-optimization/44606] " gcc at breakpoint dot cc
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: gcc at breakpoint dot cc @ 2010-06-21  9:09 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 18+ messages in thread
[parent not found: <bug-44606-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-03-17 13:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-21  9:09 [Bug tree-optimization/44606] New: Wrong SPE floating point during computation gcc at breakpoint dot cc
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
     [not found] <bug-44606-4@http.gcc.gnu.org/bugzilla/>
2010-11-02 14:39 ` dvdkhlng at gmx dot de
2010-12-30 15:47 ` froydnj at gcc dot gnu.org
2011-01-21 15:37 ` dvdkhlng at gmx dot de
2011-01-31 22:16 ` froydnj at gcc dot gnu.org
2011-02-01  2:12 ` froydnj at gcc dot gnu.org
2011-02-01  2:12 ` froydnj at gcc dot gnu.org
2011-03-16 22:48 ` bernds at gcc dot gnu.org
2011-03-17 13:13 ` gcc at breakpoint dot cc

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