[Bug target/36043] gcc reads 8 bytes for a struct of size 6 which leads to sigsegv

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Apr 25 15:09:00 GMT 2008



------- Comment #3 from rguenth at gcc dot gnu dot org  2008-04-25 15:08 -------
The problem is that struct colour is laid out like

    arg 0 <parm_decl 0x2b4f8506e2d0 c
        type <pointer_type 0x2b4f85160780 type <record_type 0x2b4f85160540
colour>
            unsigned DI
            size <integer_cst 0x2b4f85068b70 constant invariant 64>
            unit size <integer_cst 0x2b4f85068ba0 constant invariant 8>
            align 64 symtab 0 alias set -1 canonical type 0x2b4f85160780>
        used unsigned DI file t.c line 10 col 25 size <integer_cst
0x2b4f85068b70 64> unit size <integer_cst 0x2b4f85068ba0 8>
        align 64 context <function_decl 0x2b4f8515fea0 foo> initial
<pointer_type 0x2b4f85160780>
        (reg/v/f:DI 58 [ c ]) arg-type <pointer_type 0x2b4f85160780>
        incoming-rtl (reg:DI 5 di [ c ])>>

which doesn't match its natural alignment nor size.


-- 


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



More information about the Gcc-bugs mailing list