When changing n to be 0 (instead of 10) in
testsuite/gcc.c-torture/execute/ieee/mzero6.c the return value is 0 but it
should be -0,
which causes the program to abort the execution.

gcc mzero6.c -w  -O2  -fno-show-column  -lm   -funroll-loops --fast-math -O2 
-o out -da

if (__builtin_copysign (1.0, func (0.0 / -5.0, 0)) != -1.0)


If we look at the assembly we see that the return value in 0
when n = 0 (instead of d):

.L43:
lis 5,[EMAIL PROTECTED]
lfd 0,[EMAIL PROTECTED](5)
fcmpu 0,13,0
bne 0,.L47
li 3,0
bl exit


-- 
           Summary: Wrong return value in loop  (Tail call)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eres at il dot ibm dot com


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

Reply via email to