This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/61571] New: bad aliasing --> wrong FRE
- From: "xinliangli at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 Jun 2014 07:44:14 +0000
- Subject: [Bug middle-end/61571] New: bad aliasing --> wrong FRE
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61571
Bug ID: 61571
Summary: bad aliasing --> wrong FRE
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: xinliangli at gmail dot com
Compile the attached source with -m32 -std=c++11 -O2 on x86, the program will
crash. It runs fine with -m32 -std=c++11 -O2 -fno-tree-pre -fno-tree-fre.
(same failure is also observed on arm target).
The bad FRE happens in list<int>::merge function. list<int>::splice needs to be
inlined to trigger the bad CSE.
The problematic CSE is this one:
list<int>::merge (...)
{
if (this != &__c)
{
iterator __f1 = begin();
iterator __e1 = end();
iterator __f2 = __c.begin(); // this one
...
while (...)
{
}
// inline instance of splice:
if (!__c.empty())
{
__node_pointer __f = __c.__end_.__next_; // and this one
__node_pointer __l = __c.__end_.__prev_;
base::__unlink_nodes(__f, __l);
__link_nodes(__p.__ptr_, __f, __l);
base::__sz() += __c.__sz();
__c.__sz() = 0;
}
Note begin() method accesses __c.__end_.__next_.