Bug 556962 - g++44 code crashes when compiled with -O2 -fPIC and -O3 -fPIC
Summary: g++44 code crashes when compiled with -O2 -fPIC and -O3 -fPIC
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gcc44
Version: 5.4
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 743405 807971 826882
TreeView+ depends on / blocked
 
Reported: 2010-01-19 22:35 UTC by Alan Matsuoka
Modified: 2018-11-14 17:55 UTC (History)
4 users (show)

Fixed In Version: gcc44-4.4.7-1.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 826882 (view as bug list)
Environment:
Last Closed: 2013-01-08 07:14:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
test_long.cc (1.40 KB, text/x-c++src)
2010-01-19 22:36 UTC, Alan Matsuoka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 43680 0 P3 RESOLVED [DR 1022] G++ is too aggressive in optimizing away bounds checking with enums 2020-08-25 06:51:16 UTC
Red Hat Product Errata RHBA-2013:0030 0 normal SHIPPED_LIVE gcc44 bug fix and enhancement update 2013-01-07 15:28:43 UTC

Description Alan Matsuoka 2010-01-19 22:35:37 UTC
Description of problem:
The attached test_long.cc test program if compiled with -fPIC  -O2 and up will core dump at run time. Works with "-O1". Or if we use:
typedef signed int Cpp_Long;
It will work with "-O3" option but not -fPIC -O3

How reproducible:
[tammy@sjfql268v542 src]$ g++44 -fPIC -O2 test_long.cc
[tammy@sjfql268v542 src]$ ./a.out
0: 0: Plx_TopbottomEnlargementNoneName
1: 1: Plx_TopbottomEnlargementRName
2: 2: Plx_TopbottomEnlargementCName
3: 3: Plx_TopbottomEnlargementRCName
Segmentation fault

Steps to Reproduce:
see above

Actual results:
core dump with "-fPIC -O2" or up.

Expected results:
0: 0: Plx_TopbottomEnlargementNoneName
1: 1: Plx_TopbottomEnlargementRName
2: 2: Plx_TopbottomEnlargementCName
3: 3: Plx_TopbottomEnlargementRCName
ERROR: 4

Additional info:

Comment 1 Alan Matsuoka 2010-01-19 22:36:40 UTC
Created attachment 385550 [details]
test_long.cc

Comment 10 Jakub Jelinek 2010-07-01 17:49:30 UTC
This is in 4.6 now, but not backported yet.

Comment 15 RHEL Program Management 2012-04-02 10:31:04 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 28 errata-xmlrpc 2013-01-08 07:14:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0030.html


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