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++/55081] [4.8 regression?] Non-optimized static array elements initialization


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

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu.org

--- Comment #2 from Alexander Monakov <amonakov at gcc dot gnu.org> 2012-10-26 15:17:20 UTC ---
Not sure if that's relevant, but the original testcase uses 0x4000 in place of
non-compile-time-constant (&r) like this:

struct R {
        int field;
};
long* foo() {
        static long array[] = {
                sizeof(char),
          (reinterpret_cast<long>(&(reinterpret_cast<struct
R*>(0x4000)->field)) - 0x4000),              
        };
        return array;
}


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