This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/50078] New: [4.6.1+ SVN 2011-08-13] ARM wrong code: volatile accesses optimized out


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50078

             Bug #: 50078
           Summary: [4.6.1+ SVN 2011-08-13] ARM wrong code: volatile
                    accesses optimized out
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: khc@pm.waw.pl


I think armeb-pc-linux-gnueabi-gcc 4.6.2pre 20110813 (cross-compiled on x86-64)
is a bit too optimistic with -O2:

unsigned var[2];

void test(int arg)
{
    unsigned v = *(volatile unsigned *)(&var[arg]);
    *(volatile unsigned *)(&var[arg]) = v;
}

produces:
00000000 <test>:
   0:   e12fff1e        bx      lr


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]