------- Comment #2 from danglin at gcc dot gnu dot org  2006-09-16 19:18 -------
(gdb) step
get_pointer_alignment (exp=0x40013108, max_align=64)
    at ../../gcc/gcc/builtins.c:236
236       if (! POINTER_TYPE_P (TREE_TYPE (exp)))
(gdb) p debug_tree (exp)
 <var_decl 0x40013108 D.1473
    type <pointer_type 0x40089c00
        type <record_type 0x40089960 timeval type_0 SI
            size <integer_cst 0x400092b8 constant invariant 32>
            unit size <integer_cst 0x40009048 constant invariant 4>
            align 32 symtab 0 alias set -1 fields <field_decl 0x400899c0
tv_sec>
            pointer_to_this <pointer_type 0x40089c00> chain <type_decl
0x4001dc98 D.1460>>
        unsigned SI size <integer_cst 0x400092b8 32> unit size <integer_cst
0x40009048 4>
        align 32 symtab 0 alias set -1>
    used unsigned ignored SI file
/home/dave/gcc-4.2/gcc/gcc/testsuite/gcc.dg/torture/pr26565.c line 20 size
<integer_cst 0x400092b8 32> unit size <integer_cst 0x40009048 4>
    align 32 context <function_decl 0x400889a0 send_probe>
    (reg:SI 94 [ D.1473 ])>
$7 = void

get_pointer_alignment returns an alignment of 32 which appears wrong
because of the packed attribute:

struct outdata {
    long align;
    char seq;
    struct timeval tv __attribute__((packed));
};


-- 


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

Reply via email to