Bug 1126463 - test fails when openssl is compiled with gcc-4.9.1-2.fc21.1
Summary: test fails when openssl is compiled with gcc-4.9.1-2.fc21.1
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 21
Hardware: s390
OS: Unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: ZedoraTracker
TreeView+ depends on / blocked
Reported: 2014-08-04 13:30 UTC by Michal Toman
Modified: 2015-03-23 00:42 UTC (History)
3 users (show)

Fixed In Version: gcc-4.9.1-7.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-09-29 16:05:53 UTC

Attachments (Terms of Use)
sha512.i (172.50 KB, text/plain)
2014-08-04 13:30 UTC, Michal Toman
no flags Details

System ID Priority Status Summary Last Updated
GNU Compiler Collection 62025 None None None Never

Description Michal Toman 2014-08-04 13:30:44 UTC
Created attachment 923877 [details]

The sha512t test fails when openssl is compiled with gcc-4.9.1-2.fc21.1.s390 with -O2, while -O1 and -O0 work correctly.

I have tracked the problem down to function sha512_block_data_order from file crypto/sha/sha512.c. Prefixing the function with __attribute__((optimize (0))) fixes the problem. __attribute__((noinline,noclone)) does not help - the test is still failing. The program does not crash, it just calculates a wrong result.

Attaching the preprocessed source.

Comment 1 Jakub Jelinek 2014-08-04 13:38:56 UTC
Can you turn this into a self-contained testcase?  I.e. create a short main
that will populate the SHA512_CTX with some values that show the miscompilation, point it to unsigned long long array filled, call sha512_block_data_order with those arguments and after calling it e.g. compare SHA512_CTX content if it is the expected one?  Thanks.

Comment 3 Jakub Jelinek 2014-08-05 15:00:12 UTC
Now tracked upstream as PR62025.

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