Compilation:
   arm-unknown-linux-gnueabi-g++ -Os -mcpu=cortex-a8 -o test test.cpp

Expected results:
   ./test
   65534 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Real results (some garbage data):
   ./test
   544 544 544 544 544 544 544 544 544 544 544 544 544 544 544 544

Note: This is not a big practical issue because Qt 4.7 does not use packed
attribute for QChar anymore (a good idea because using this packed attribute
results in a horribly slow code):
http://qt.gitorious.org/qt/qt/commit/1ec8acd77b6c048f5a68887ac7750b0764ade598


-- 
           Summary: Miscompiled c++ class with packed attribute on ARM with
                    -Os optimizations (Qt 4.6.2)
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: siarhei dot siamashka at gmail dot com
GCC target triplet: arm-unknown-linux-gnueabi


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

Reply via email to