From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24935 invoked by alias); 21 Jun 2010 09:09:58 -0000 Received: (qmail 24857 invoked by uid 48); 21 Jun 2010 09:09:44 -0000 Date: Mon, 21 Jun 2010 09:09:00 -0000 Subject: [Bug tree-optimization/44606] New: Wrong SPE floating point during computation X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "gcc at breakpoint dot cc" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-06/txt/msg01999.txt.bz2 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