Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
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:
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.
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
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: