You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Farid Zaripov (JIRA)" <ji...@apache.org> on 2006/06/30 09:44:31 UTC
[jira] Created: (STDCXX-248) [Intel C++ 9.1/Windows] codegeneration
bug
[Intel C++ 9.1/Windows] codegeneration bug
------------------------------------------
Key: STDCXX-248
URL: http://issues.apache.org/jira/browse/STDCXX-248
Project: C++ Standard Library
Type: Bug
Components: External
Versions: 4.1.3
Environment: Intel C++ 9.1, Windows
Reporter: Farid Zaripov
The program below is expected to run without assert. When compiled with Intel C++ 9.1 on Windows, it's terminated with runtime error instead. Note that MSVC++ 7.1 behaves as expected.
======================================================================
#include <cassert>
struct UserChar
{
long double f;
unsigned char c;
};
struct UserInt
{
int i_;
UserChar to_char () const
{
const UserChar tmp = { 0, i_ };
return tmp;
}
UserChar to_char2 () const
{
UserChar tmp = { 0, i_ };
return tmp;
}
UserChar to_char3 () const
{
UserChar tmp = { 0 };
tmp.c = i_;
return tmp;
}
};
int main(int argc, char* argv[])
{
const char TEST_CHAR = 'a';
UserInt ui = { TEST_CHAR };
UserChar uc = ui.to_char ();
UserChar uc2 = ui.to_char2 ();
UserChar uc3 = ui.to_char3 ();
assert (TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c);
return 0;
}
======================================================================
icl icl91_test.cpp
Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20060323Z
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
icl91_test.cpp
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
-out:icl91_test.exe
icl91_test.obj
======================================================================
icl91_test.exe
Assertion failed: TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c,
file icl91_test.cpp, line 43
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
======================================================================
Generated assembler code:
UserChar to_char () const
00439A44 push ebp
00439A45 mov ebp,esp
00439A47 push esi
00439A48 mov dword ptr [ebp-4],ecx
const UserChar tmp = { 0, i_ };
00439A4B fldz
00439A4D mov eax,dword ptr [ebp+8]
00439A50 fstp qword ptr [eax]
return tmp;
00439A52 mov eax,dword ptr [ebp+8]
00439A55 leave
00439A56 ret 4
tmp.c is not initialized by value this->i_ and as a result it contains a random value.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Closed: (STDCXX-248) [Intel C++ 9.1/Windows] bad codegen
initializing const POD struct
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov closed STDCXX-248.
--------------------------------
Resolution: Fixed
Fix Version/s: trunk
The bug is not reproducible on latest icc 9.1 (Build 20070510Z Package ID: W_CC_C_9.1.038)
> [Intel C++ 9.1/Windows] bad codegen initializing const POD struct
> -----------------------------------------------------------------
>
> Key: STDCXX-248
> URL: https://issues.apache.org/jira/browse/STDCXX-248
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Affects Versions: 4.1.3
> Environment: Intel C++ 9.1, Windows
> Reporter: Farid Zaripov
> Assignee: Farid Zaripov
> Priority: Minor
> Fix For: trunk
>
>
> The program below is expected to run without assert. When compiled with Intel C++ 9.1 on Windows, it's terminated with runtime error instead. Note that MSVC++ 7.1 behaves as expected.
> ======================================================================
> #include <cassert>
> struct UserChar
> {
> long double f;
> unsigned char c;
> };
> struct UserInt
> {
> int i_;
> UserChar to_char () const
> {
> const UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char2 () const
> {
> UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char3 () const
> {
> UserChar tmp = { 0 };
> tmp.c = i_;
> return tmp;
> }
> };
> int main(int argc, char* argv[])
> {
> const char TEST_CHAR = 'a';
> UserInt ui = { TEST_CHAR };
> UserChar uc = ui.to_char ();
> UserChar uc2 = ui.to_char2 ();
> UserChar uc3 = ui.to_char3 ();
> assert (TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c);
> return 0;
> }
> ======================================================================
> icl icl91_test.cpp
> Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20060323Z
> Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
> icl91_test.cpp
> Microsoft (R) Incremental Linker Version 7.10.3077
> Copyright (C) Microsoft Corporation. All rights reserved.
> -out:icl91_test.exe
> icl91_test.obj
> ======================================================================
> icl91_test.exe
> Assertion failed: TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c,
> file icl91_test.cpp, line 43
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> ======================================================================
> Generated assembler code:
> UserChar to_char () const
> 00439A44 push ebp
> 00439A45 mov ebp,esp
> 00439A47 push esi
> 00439A48 mov dword ptr [ebp-4],ecx
> const UserChar tmp = { 0, i_ };
> 00439A4B fldz
> 00439A4D mov eax,dword ptr [ebp+8]
> 00439A50 fstp qword ptr [eax]
> return tmp;
> 00439A52 mov eax,dword ptr [ebp+8]
> 00439A55 leave
> 00439A56 ret 4
> tmp.c is not initialized by value this->i_ and as a result it contains a random value.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-248) [Intel C++ 9.1/Windows] bad codegen
initializing const POD struct
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/STDCXX-248?page=comments#action_12425920 ]
Martin Sebor commented on STDCXX-248:
-------------------------------------
See this thread:
http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200606.mbox/%3c44A3EC2F.8070003@kyiv.vdiweb.com%3e
> [Intel C++ 9.1/Windows] bad codegen initializing const POD struct
> -----------------------------------------------------------------
>
> Key: STDCXX-248
> URL: http://issues.apache.org/jira/browse/STDCXX-248
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Affects Versions: 4.1.3
> Environment: Intel C++ 9.1, Windows
> Reporter: Farid Zaripov
> Priority: Minor
>
> The program below is expected to run without assert. When compiled with Intel C++ 9.1 on Windows, it's terminated with runtime error instead. Note that MSVC++ 7.1 behaves as expected.
> ======================================================================
> #include <cassert>
> struct UserChar
> {
> long double f;
> unsigned char c;
> };
> struct UserInt
> {
> int i_;
> UserChar to_char () const
> {
> const UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char2 () const
> {
> UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char3 () const
> {
> UserChar tmp = { 0 };
> tmp.c = i_;
> return tmp;
> }
> };
> int main(int argc, char* argv[])
> {
> const char TEST_CHAR = 'a';
> UserInt ui = { TEST_CHAR };
> UserChar uc = ui.to_char ();
> UserChar uc2 = ui.to_char2 ();
> UserChar uc3 = ui.to_char3 ();
> assert (TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c);
> return 0;
> }
> ======================================================================
> icl icl91_test.cpp
> Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20060323Z
> Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
> icl91_test.cpp
> Microsoft (R) Incremental Linker Version 7.10.3077
> Copyright (C) Microsoft Corporation. All rights reserved.
> -out:icl91_test.exe
> icl91_test.obj
> ======================================================================
> icl91_test.exe
> Assertion failed: TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c,
> file icl91_test.cpp, line 43
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> ======================================================================
> Generated assembler code:
> UserChar to_char () const
> 00439A44 push ebp
> 00439A45 mov ebp,esp
> 00439A47 push esi
> 00439A48 mov dword ptr [ebp-4],ecx
> const UserChar tmp = { 0, i_ };
> 00439A4B fldz
> 00439A4D mov eax,dword ptr [ebp+8]
> 00439A50 fstp qword ptr [eax]
> return tmp;
> 00439A52 mov eax,dword ptr [ebp+8]
> 00439A55 leave
> 00439A56 ret 4
> tmp.c is not initialized by value this->i_ and as a result it contains a random value.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (STDCXX-248) [Intel C++ 9.1/Windows] bad codegen
initializing const POD struct
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov updated STDCXX-248:
---------------------------------
Fix Version/s: (was: trunk)
4.2
> [Intel C++ 9.1/Windows] bad codegen initializing const POD struct
> -----------------------------------------------------------------
>
> Key: STDCXX-248
> URL: https://issues.apache.org/jira/browse/STDCXX-248
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Affects Versions: 4.1.3
> Environment: Intel C++ 9.1, Windows
> Reporter: Farid Zaripov
> Assignee: Farid Zaripov
> Priority: Minor
> Fix For: 4.2
>
>
> The program below is expected to run without assert. When compiled with Intel C++ 9.1 on Windows, it's terminated with runtime error instead. Note that MSVC++ 7.1 behaves as expected.
> ======================================================================
> #include <cassert>
> struct UserChar
> {
> long double f;
> unsigned char c;
> };
> struct UserInt
> {
> int i_;
> UserChar to_char () const
> {
> const UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char2 () const
> {
> UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char3 () const
> {
> UserChar tmp = { 0 };
> tmp.c = i_;
> return tmp;
> }
> };
> int main(int argc, char* argv[])
> {
> const char TEST_CHAR = 'a';
> UserInt ui = { TEST_CHAR };
> UserChar uc = ui.to_char ();
> UserChar uc2 = ui.to_char2 ();
> UserChar uc3 = ui.to_char3 ();
> assert (TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c);
> return 0;
> }
> ======================================================================
> icl icl91_test.cpp
> Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20060323Z
> Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
> icl91_test.cpp
> Microsoft (R) Incremental Linker Version 7.10.3077
> Copyright (C) Microsoft Corporation. All rights reserved.
> -out:icl91_test.exe
> icl91_test.obj
> ======================================================================
> icl91_test.exe
> Assertion failed: TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c,
> file icl91_test.cpp, line 43
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> ======================================================================
> Generated assembler code:
> UserChar to_char () const
> 00439A44 push ebp
> 00439A45 mov ebp,esp
> 00439A47 push esi
> 00439A48 mov dword ptr [ebp-4],ecx
> const UserChar tmp = { 0, i_ };
> 00439A4B fldz
> 00439A4D mov eax,dword ptr [ebp+8]
> 00439A50 fstp qword ptr [eax]
> return tmp;
> 00439A52 mov eax,dword ptr [ebp+8]
> 00439A55 leave
> 00439A56 ret 4
> tmp.c is not initialized by value this->i_ and as a result it contains a random value.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (STDCXX-248) [Intel C++ 9.1/Windows] bad codegen
initializing const POD struct
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov reassigned STDCXX-248:
------------------------------------
Assignee: Farid Zaripov
> [Intel C++ 9.1/Windows] bad codegen initializing const POD struct
> -----------------------------------------------------------------
>
> Key: STDCXX-248
> URL: https://issues.apache.org/jira/browse/STDCXX-248
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Affects Versions: 4.1.3
> Environment: Intel C++ 9.1, Windows
> Reporter: Farid Zaripov
> Assignee: Farid Zaripov
> Priority: Minor
>
> The program below is expected to run without assert. When compiled with Intel C++ 9.1 on Windows, it's terminated with runtime error instead. Note that MSVC++ 7.1 behaves as expected.
> ======================================================================
> #include <cassert>
> struct UserChar
> {
> long double f;
> unsigned char c;
> };
> struct UserInt
> {
> int i_;
> UserChar to_char () const
> {
> const UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char2 () const
> {
> UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char3 () const
> {
> UserChar tmp = { 0 };
> tmp.c = i_;
> return tmp;
> }
> };
> int main(int argc, char* argv[])
> {
> const char TEST_CHAR = 'a';
> UserInt ui = { TEST_CHAR };
> UserChar uc = ui.to_char ();
> UserChar uc2 = ui.to_char2 ();
> UserChar uc3 = ui.to_char3 ();
> assert (TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c);
> return 0;
> }
> ======================================================================
> icl icl91_test.cpp
> Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20060323Z
> Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
> icl91_test.cpp
> Microsoft (R) Incremental Linker Version 7.10.3077
> Copyright (C) Microsoft Corporation. All rights reserved.
> -out:icl91_test.exe
> icl91_test.obj
> ======================================================================
> icl91_test.exe
> Assertion failed: TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c,
> file icl91_test.cpp, line 43
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> ======================================================================
> Generated assembler code:
> UserChar to_char () const
> 00439A44 push ebp
> 00439A45 mov ebp,esp
> 00439A47 push esi
> 00439A48 mov dword ptr [ebp-4],ecx
> const UserChar tmp = { 0, i_ };
> 00439A4B fldz
> 00439A4D mov eax,dword ptr [ebp+8]
> 00439A50 fstp qword ptr [eax]
> return tmp;
> 00439A52 mov eax,dword ptr [ebp+8]
> 00439A55 leave
> 00439A56 ret 4
> tmp.c is not initialized by value this->i_ and as a result it contains a random value.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (STDCXX-248) [Intel C++ 9.1/Windows] codegeneration
bug
Posted by "Anton Pevtsov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/STDCXX-248?page=all ]
Anton Pevtsov updated STDCXX-248:
---------------------------------
Priority: Minor (was: Major)
Opened the issue in Intel:
https://premier.intel.com/premier/IssueDetail.aspx?IssueID=380635
> [Intel C++ 9.1/Windows] codegeneration bug
> ------------------------------------------
>
> Key: STDCXX-248
> URL: http://issues.apache.org/jira/browse/STDCXX-248
> Project: C++ Standard Library
> Type: Bug
> Components: External
> Versions: 4.1.3
> Environment: Intel C++ 9.1, Windows
> Reporter: Farid Zaripov
> Priority: Minor
>
> The program below is expected to run without assert. When compiled with Intel C++ 9.1 on Windows, it's terminated with runtime error instead. Note that MSVC++ 7.1 behaves as expected.
> ======================================================================
> #include <cassert>
> struct UserChar
> {
> long double f;
> unsigned char c;
> };
> struct UserInt
> {
> int i_;
> UserChar to_char () const
> {
> const UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char2 () const
> {
> UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char3 () const
> {
> UserChar tmp = { 0 };
> tmp.c = i_;
> return tmp;
> }
> };
> int main(int argc, char* argv[])
> {
> const char TEST_CHAR = 'a';
> UserInt ui = { TEST_CHAR };
> UserChar uc = ui.to_char ();
> UserChar uc2 = ui.to_char2 ();
> UserChar uc3 = ui.to_char3 ();
> assert (TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c);
> return 0;
> }
> ======================================================================
> icl icl91_test.cpp
> Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20060323Z
> Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
> icl91_test.cpp
> Microsoft (R) Incremental Linker Version 7.10.3077
> Copyright (C) Microsoft Corporation. All rights reserved.
> -out:icl91_test.exe
> icl91_test.obj
> ======================================================================
> icl91_test.exe
> Assertion failed: TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c,
> file icl91_test.cpp, line 43
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> ======================================================================
> Generated assembler code:
> UserChar to_char () const
> 00439A44 push ebp
> 00439A45 mov ebp,esp
> 00439A47 push esi
> 00439A48 mov dword ptr [ebp-4],ecx
> const UserChar tmp = { 0, i_ };
> 00439A4B fldz
> 00439A4D mov eax,dword ptr [ebp+8]
> 00439A50 fstp qword ptr [eax]
> return tmp;
> 00439A52 mov eax,dword ptr [ebp+8]
> 00439A55 leave
> 00439A56 ret 4
> tmp.c is not initialized by value this->i_ and as a result it contains a random value.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (STDCXX-248) [Intel C++ 9.1/Windows] bad codegen
initializing const POD struct
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/STDCXX-248?page=all ]
Martin Sebor updated STDCXX-248:
--------------------------------
Summary: [Intel C++ 9.1/Windows] bad codegen initializing const POD struct (was: [Intel C++ 9.1/Windows] codegeneration bug)
> [Intel C++ 9.1/Windows] bad codegen initializing const POD struct
> -----------------------------------------------------------------
>
> Key: STDCXX-248
> URL: http://issues.apache.org/jira/browse/STDCXX-248
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Affects Versions: 4.1.3
> Environment: Intel C++ 9.1, Windows
> Reporter: Farid Zaripov
> Priority: Minor
>
> The program below is expected to run without assert. When compiled with Intel C++ 9.1 on Windows, it's terminated with runtime error instead. Note that MSVC++ 7.1 behaves as expected.
> ======================================================================
> #include <cassert>
> struct UserChar
> {
> long double f;
> unsigned char c;
> };
> struct UserInt
> {
> int i_;
> UserChar to_char () const
> {
> const UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char2 () const
> {
> UserChar tmp = { 0, i_ };
> return tmp;
> }
> UserChar to_char3 () const
> {
> UserChar tmp = { 0 };
> tmp.c = i_;
> return tmp;
> }
> };
> int main(int argc, char* argv[])
> {
> const char TEST_CHAR = 'a';
> UserInt ui = { TEST_CHAR };
> UserChar uc = ui.to_char ();
> UserChar uc2 = ui.to_char2 ();
> UserChar uc3 = ui.to_char3 ();
> assert (TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c);
> return 0;
> }
> ======================================================================
> icl icl91_test.cpp
> Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20060323Z
> Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
> icl91_test.cpp
> Microsoft (R) Incremental Linker Version 7.10.3077
> Copyright (C) Microsoft Corporation. All rights reserved.
> -out:icl91_test.exe
> icl91_test.obj
> ======================================================================
> icl91_test.exe
> Assertion failed: TEST_CHAR == uc.c && TEST_CHAR == uc2.c && TEST_CHAR == uc3.c,
> file icl91_test.cpp, line 43
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> ======================================================================
> Generated assembler code:
> UserChar to_char () const
> 00439A44 push ebp
> 00439A45 mov ebp,esp
> 00439A47 push esi
> 00439A48 mov dword ptr [ebp-4],ecx
> const UserChar tmp = { 0, i_ };
> 00439A4B fldz
> 00439A4D mov eax,dword ptr [ebp+8]
> 00439A50 fstp qword ptr [eax]
> return tmp;
> 00439A52 mov eax,dword ptr [ebp+8]
> 00439A55 leave
> 00439A56 ret 4
> tmp.c is not initialized by value this->i_ and as a result it contains a random value.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira