<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>1121</bug_id>
          
          <creation_ts>2011-05-27 05:09:10 +0000</creation_ts>
          <short_desc>LSB 4.1:  error from &quot;abs&quot; of math function</short_desc>
          <delta_ts>2013-04-12 07:33:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.0-alpha</version>
          <rep_platform>mpc8315e-rdb</rep_platform>
          <op_sys>ppc</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.4 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xiaofeng Yan">Xiaofeng.yan</reporter>
          <assigned_to name="Kai Kang">kai.kang</assigned_to>
          <cc>brett.ciphery</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>kai.kang</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>14046</commentid>
    <comment_count>0</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2011-05-27 05:09:10 +0000</bug_when>
    <thetext>/26_numerics/complex/13450.cc 1 	failed 	
Message from the test:

DejaGNUTest.command_1: 
DejaGNUTest.command_1: /opt/lsb/test/lib/libstdcpp_4.1.0/_26_numerics_complex_13450.exe
DejaGNUTest.command_1: 
DejaGNUTest.command_1: 
DejaGNUTest.command_output_1: 
DejaGNUTest.command_output_1: _26_numerics_complex_13450.exe: /nethome/autobuild/tmp/rpm-build/BUILD/lsb-test-libstdcpp-4.1.0/testsuite/26_numerics/complex/13450.cc:41: void test01_do(T, T) [with T = long double]: Assertion `abs(ref - res2) &lt; eps&apos; failed.
DejaGNUTest.command_output_1: 
DejaGNUTest.command_output_1: 
DejaGNUTest.command_status_1: 6
DejaGNUTest.result_1: FAIL: 26_numerics/complex/13450.cc execution test
INFO: qmtest.cause: 26_numerics/complex/13450.cc execution test
INFO: qmtest.end_time: 2011-05-23T01:06:49Z
INFO: qmtest.start_time: 2011-05-23T01:06:49Z
INFO: qmtest.target: local</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14047</commentid>
    <comment_count>1</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2011-05-27 05:09:42 +0000</bug_when>
    <thetext>I record this bug and will fix it on 1.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14107</commentid>
    <comment_count>2</comment_count>
      <attachid>169</attachid>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2011-05-31 23:38:02 +0000</bug_when>
    <thetext>Created attachment 169
test program about data type long double</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14108</commentid>
    <comment_count>3</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2011-05-31 23:50:28 +0000</bug_when>
    <thetext>Hi Mark,

This bug is caused by data type &quot;long double&quot;.
Please check attachment to get test program. 
Look at my test steps
$./powerpc-poky-linux-g++ abs.cc -o abs -g
mpc8315e#./abs
c

When I run this program on x86 (OS ubuntu), I got information &quot;a&quot; instead of &quot;c&quot;. The correct result should be &quot;a&quot;.
if the type of variable &quot;ld1&quot; and &quot;ld2&quot; is &quot;long&quot; or &quot;double&quot;, output information is &quot;a&quot; on mpc8315e.
I think it is float-precision problem. I don&apos;t know this bug comes from  hardware or complication tool or glibc? Can you give me suggestion about my question?

I have checked that mpc8315e supports hard-float.
TARGET_CC_ARCH = &quot;-mcpu=603e  -mhard-float&quot; 

The following information come from gdb
test01_do&lt;long double&gt; (a=-3.2000000000000002, b=1.3999999999999999)
    at abs.cc:11
11          bool test __attribute__((unused)) = true;
(gdb) n
14          T eps = numeric_limits&lt;T&gt;::epsilon() * 100;
(gdb) n
16          cplx ref = pow(cplx(a, T()), cplx(b, T()));
(gdb) n
17          cplx res1 = pow(a, cplx(b, T()));
(gdb) n
18          cplx res2 = pow(cplx(a, T()), b);
(gdb) n
20           assert (abs(ref - res1) &lt; eps);
(gdb) p ref
$1 = {_M_value = -1.5746800804295207 + -4.8463669598557395 * I}
(gdb) p res1
$2 = {_M_value = -1.5746800804295207 + -4.8463669598557395 * I}
(gdb) p res2
$3 = {_M_value = -1.5746800804295207 + -4.8463669598557395 * I}
(gdb) p eps
$4 = 4.9406564584124654e-322
(gdb) n
21           assert( abs(ref - res2) &lt; eps );
(gdb) p eps
$5 = 4.9406564584124654e-322
(gdb) p ref
$6 = {_M_value = -1.5746800804295207 + -4.8463669598557395 * I}
(gdb) p eps
$7 = 4.9406564584124654e-322
(gdb) p ref
$8 = {_M_value = -1.5746800804295207 + -4.8463669598557395 * I}
(gdb) p res1
$9 = {_M_value = -1.5746800804295207 + -4.8463669598557395 * I}
(gdb) p res2
$10 = {_M_value = -1.5746800804295207 + -4.8463669598557395 * I}
(gdb) p ref
$11 = {_M_value = -1.5746800804295207 + -4.8463669598557395 * I}
(gdb) n    
abs: abs.cc:21: void test01_do(T, T) [with T = long double]: Assertion `abs(ref - res2) &lt; eps&apos; failed.

Program received signal SIGABRT, Aborted.
0x0fe55e9c in raise () from /lib/libc.so.6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14112</commentid>
    <comment_count>4</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2011-06-01 05:30:09 +0000</bug_when>
    <thetext>Hi Mark,

I also check the user manual of e300 core. It says single-precision(32bits) and double-precision(64 bits) can be supported but I don&apos;t know whether quad-precision(128 bits) is supported or not? I can&apos;t find this words. I also run this test binary on wind river ppc(e440) platform and get same result. I guess it could be real hardware problem. At present wind river makes lsb test by LSB 4.0. We use LSB 4.1 to make lsb test for yocto.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14121</commentid>
    <comment_count>5</comment_count>
    <who name="Brett Ciphery">brett.ciphery</who>
    <bug_when>2011-06-01 11:01:15 +0000</bug_when>
    <thetext>This looks like an acknowledged upstream bug:

http://bugs.linuxbase.org/show_bug.cgi?id=2447

So it&apos;s not necessary to fix anything, the problem will be waived.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14470</commentid>
    <comment_count>6</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2011-06-29 04:40:22 +0000</bug_when>
    <thetext>upstream http://bugs.linuxbase.org/show_bug.cgi?id=2447</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26691</commentid>
    <comment_count>7</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-10-18 07:37:44 +0000</bug_when>
    <thetext>Libstdc++ test aborted on ppc, so can&apos;t verify this on ppc. Pass on x86 and x86_64</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30019</commentid>
    <comment_count>8</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2013-02-22 07:36:57 +0000</bug_when>
    <thetext>Test passed with &quot;lsb-test-libstdcpp v. 4.1.0-18.lsb4 &quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32027</commentid>
    <comment_count>9</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2013-04-12 07:33:08 +0000</bug_when>
    <thetext>Verified with 1.4 M5 RC3.

Git rev: master/fe336b149552b1f4f24d979c40302653298b98cc</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>169</attachid>
            <date>2011-05-31 23:38:02 +0000</date>
            <delta_ts>2011-05-31 23:38:02 +0000</delta_ts>
            <desc>test program about data type long double</desc>
            <filename>abs.cc</filename>
            <type>text/x-c++src</type>
            <size>700</size>
            <attacher name="Xiaofeng Yan">Xiaofeng.yan</attacher>
            
              <data encoding="base64">I2luY2x1ZGUgPGNvbXBsZXg+CiNpbmNsdWRlIDxsaW1pdHM+CiNpbmNsdWRlIDxjc3RkbGliPgoj
aW5jbHVkZSA8YXNzZXJ0Lmg+CiNpbmNsdWRlIDxzdGRpby5oPgoKdGVtcGxhdGU8dHlwZW5hbWUg
VD4KICB2b2lkIHRlc3QwMV9kbyhUIGEsIFQgYikKICB7CiAgICB1c2luZyBuYW1lc3BhY2Ugc3Rk
OwogICAgYm9vbCB0ZXN0IF9fYXR0cmlidXRlX18oKHVudXNlZCkpID0gdHJ1ZTsKICAgIHR5cGVk
ZWYgY29tcGxleDxUPiBjcGx4OwoKICAgIFQgZXBzID0gbnVtZXJpY19saW1pdHM8VD46OmVwc2ls
b24oKSAqIDEwMDsKCiAgICBjcGx4IHJlZiA9IHBvdyhjcGx4KGEsIFQoKSksIGNwbHgoYiwgVCgp
KSk7CiAgICBjcGx4IHJlczEgPSBwb3coYSwgY3BseChiLCBUKCkpKTsKICAgIGNwbHggcmVzMiA9
IHBvdyhjcGx4KGEsIFQoKSksIGIpOwoKICAgIGlmIChhYnMocmVmLXJlczIpIDwgZXBzICkKICAg
ICAgICBwcmludGYoImFcbiIpOwogICAgZWxzZSBpZihhYnMocmVmLXJlczIpID09IGVwcykKICAg
ICAgICBwcmludGYoImJcbiIpOwogICAgZWxzZQogICAgICAgIHByaW50ZigiY1xuIik7CiAgfQoK
CmludCBtYWluKCkKewogICAgbG9uZyBkb3VibGUgbGQxOwogICAgbG9uZyBkb3VibGUgbGQyOwog
ICAgbGQxID0gLTMuMmw7CiAgICBsZDIgPSAxLjRsOwogICAgdGVzdDAxX2RvKGxkMSwgbGQyKTsK
ICAgIHJldHVybiAwOwp9Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>