Fixes are available
APAR status
Closed as program error.
Error description
The following test case causes an incorrect output during runtime at -O2. ===== Compile options: $ xlc test.c -O2 ===== Test case: $ cat test.c typedef struct dataTy Data; void bar(Data *); void foo(void) { bar(0); } struct dataTy { int x; }; Data new_data(); int main(void) { Data datA = { 66 }; datA = new_data(); return datA.x; } void bar(Data *d) { } Data new_data() { Data ret = { 55 }; return ret; } $ ===== ACTUAL OUTPUT: $ xlc test.c -O2 && ./a.out $ echo $? 66 $ ===== EXPECTED OUTPUT: $ xlc test.c -O2 && ./a.out $ echo $? 55 $
Local fix
n/a
Problem summary
USERS AFFECTED: Users using typedef struct before it gets defined may be affected by this issue. PROBLEM DESCRIPTION: This issue leads to wrong results at run time when optimization is turned on.
Problem conclusion
The above issue has been fixed.
Temporary fix
Comments
APAR Information
APAR number
LI76889
Reported component name
XL C/C++ RHEL52
Reported component ID
5724U8310
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2012-07-16
Closed date
2012-07-16
Last modified date
2012-07-23
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL C/C++ RHEL52
Fixed component ID
5724U8310
Applicable component levels
RA10 PSN LI76865
UP06/09/13
[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]
Document Information
Modified date:
16 October 2021