Bug 1686696

Summary: gcc, s390x: -fcode-hoisting error
Product: [Fedora] Fedora Reporter: Jerry James <loganjerry>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: aoliva, davejohansen, dmalcolm, fweimer, jakub, jwakely, law, mpolacek, msebor, nickc
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: gcc-9.0.1-0.10.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-29 19:14:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Reduced test case from gmp-ecm none

Description Jerry James 2019-03-08 03:14:59 UTC
Created attachment 1542027 [details]
Reduced test case from gmp-ecm

Description of problem:
The gmp-ecm package failed the mass rebuild, on s390x only.  I will attach a reduced version of the failing test.  When built with "gcc -O2 -Wall -Wextra -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations", the code segfaults due to walking off the end of an allocated block of memory.  Libusan is unavailable on s390x, so I cannot check with -fsanitize=undefined, but on x86_64 the sanitizer gives no errors.

When built with "gcc -O2 -fno-code-hoisting", the code does not segfault, and neither valgrind nor the address sanitizer shows any errors.

Version-Release number of selected component (if applicable):
gcc-9.0.1-0.4.fc30.s390x

How reproducible:
Always

Steps to Reproduce:
1. Build the attached code with -O2
2.
3.

Actual results:
The code segfaults unless -fno-code-hoisting is also given.

Expected results:
No segfault.

Additional info:

Comment 1 Jakub Jelinek 2019-03-08 09:47:35 UTC
This seems to be fixed with upstream http://gcc.gnu.org/r269302 aka http://gcc.gnu.org/PR89497 fix.

Comment 2 Jerry James 2019-03-08 22:52:26 UTC
Great!  Thank you, Jakub.

Comment 3 Fedora Update System 2019-03-13 09:42:22 UTC
gcc-9.0.1-0.10.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-833ad0f15b

Comment 4 Fedora Update System 2019-03-13 15:36:55 UTC
gcc-9.0.1-0.10.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-833ad0f15b

Comment 5 Fedora Update System 2019-03-29 19:14:42 UTC
gcc-9.0.1-0.10.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.