RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1000991 - fmaf() function get a wrong rounded result
Summary: fmaf() function get a wrong rounded result
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: glibc
Version: 6.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Patsy Griffin
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-26 09:25 UTC by Dmitry
Modified: 2016-11-24 15:56 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-16 18:36:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
test example and Makefile (769 bytes, application/x-rar)
2013-08-26 09:25 UTC, Dmitry
no flags Details

Description Dmitry 2013-08-26 09:25:32 UTC
Created attachment 790358 [details]
test example and Makefile

Description of problem:
fmaf() function get a wrong rounded result when arguments are passed through variables
There are three variants.
First. Arguments are passed to fmaf() by pointers referenced to floating point single precision numbers placed in int32 type variables (0x007ffffa, 0x4ea00000, 0x00000001) 
The result is wrong and equal 0x0f9ffff8.
Second. 
Arguments are passed to fmaf() by pointers referenced to floating point single precision numbers placed in float type variables (a=0x0.fffff4p-126, b=0x1.400000p30, c=0x0.000002p-126). The result is also wrong and equal 0x0f9ffff8.
Third.
Floating point numbers are passed as immediate values(0x0.fffff4p-126, 0x1.400000p30, 0x0.000002p-126). Result is correct and equal 0x0f9ffff9.
The difference between wrong and correct results is one ulp.

Version-Release number of selected component (if applicable):
glibc version 2.12, gnu_get_libc_version()
Red Hat Enterprise Linux 6.4

How reproducible:
make -f Makefile_bug
main_bug

Steps to Reproduce:
1.
2.
3.

Actual results:
0x0f9ffff8

Expected results:
0x0f9ffff9

Additional info:

Comment 2 Dmitry 2013-08-30 14:36:22 UTC
Carlos, are you going to look at the bug?

Comment 3 Carlos O'Donell 2013-09-02 15:35:20 UTC
Dmitry,

Thanks for submitting this bug.

Your example is unfortunately illegal since it violates ISO C strict aliasing. For example you assign a pointer to int/unsigned int and float to the same address, all of this needs to be done through unions to be safe. Please make sure that `-Wall -pedantic' don't produce any errors when you compile.

To learn more about strict aliasing please read:
http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html

One of our developers looked into this and I'll let her update the issue.

We are not going to include this in rhel-6.5, but we may consider it for rhel-6.6.

Comment 5 Patsy Griffin 2013-09-16 15:04:29 UTC
Dmitry,

I was able to confirm that your test program produces the correct results on a RHEL 6.5 system with FMA support.

I will be closing this bug report.

Please reopen this bug report if you continue to see incorrect results on RHEL 6.5.

Thank You,
Patsy


Note You need to log in before you can comment on or make changes to this bug.