public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/61571] New: bad aliasing --> wrong FRE
@ 2014-06-20  7:44 xinliangli at gmail dot com
  2014-06-20  7:45 ` [Bug middle-end/61571] " xinliangli at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: xinliangli at gmail dot com @ 2014-06-20  7:44 UTC (permalink / raw)
  To: gcc-bugs

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_.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-23 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-20  7:44 [Bug middle-end/61571] New: bad aliasing --> wrong FRE xinliangli at gmail dot com
2014-06-20  7:45 ` [Bug middle-end/61571] " xinliangli at gmail dot com
2014-06-23 10:31 ` rguenth at gcc dot gnu.org
2014-06-23 11:35 ` rguenth at gcc dot gnu.org
2014-06-23 16:12 ` xinliangli at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).