------- Comment #3 from amylaar at gcc dot gnu dot org 2006-04-20 18:05 ------- (In reply to comment #2) > You might want to dive into builtins.c:get_pointer_alignment. >
Hmm, indeed, I see that in 3.5.0 20040512, expand_builtin_memcpy has found a dest_align of 32 and proceeded to go the store_by_pieces route. The tree passed to get_poiter_alignment for the destination was: <nop_expr 0xb57cd794 type <pointer_type 0xb58411b0 type <integer_type 0xb58562f4 char QI size <integer_cst 0xb5854104 constant 8> unit size <integer_cst 0xb5854118 constant 1> align 8 symtab 0 alias set -1 precision 8 min <integer_cst 0xb58541a 4 -128> max <integer_cst 0xb58541b8 127> pointer_to_this <pointer_type 0xb58411b0>> unsigned SI size <integer_cst 0xb58547a8 constant 32> unit size <integer_cst 0xb58547d0 constant 4> align 32 symtab 0 alias set -1> arg 0 <plus_expr 0xb583e150 type <pointer_type 0xb57ce438 type <array_type 0xb57ce0d8> unsigned SI size <integer_cst 0xb58547a8 32> unit size <integer_cst 0xb58547d0 4> align 32 symtab 0 alias set -1> arg 0 <nop_expr 0xb57cd780 type <pointer_type 0xb57ce438> arg 0 <addr_expr 0xb57cd730 type <pointer_type 0xb57ce4a4> arg 0 <var_decl 0xb57ce288 s>>> arg 1 <integer_cst 0xb57cd76c constant 4>>> In mainline, the calculated dest_align is 8. The tree passed to get_pointer_alignment is: <addr_expr 0xb58b13e0 type <pointer_type 0xb58c6170 type <integer_type 0xb58bd170 char sizes-gimplified public string-flag QI size <integer_cst 0xb58ac1c8 constant invariant 8> unit size <integer_cst 0xb58ac1e0 constant invariant 1> align 8 symtab 0 alias set -1 precision 8 min <integer_cst 0xb58ac228 -128> max <integer_cst 0xb58ac288 127> pointer_to_this <pointer_type 0xb58c6170>> unsigned SI size <integer_cst 0xb58ac3c0 constant invariant 32> unit size <integer_cst 0xb58ac150 constant invariant 4> align 32 symtab 0 alias set -1> invariant arg 0 <array_ref 0xb593a820 type <integer_type 0xb58bd170 char> arg 0 <component_ref 0xb58bb078 type <array_type 0xb5938730> arg 0 <var_decl 0xb58ba108 s> arg 1 <field_decl 0xb593878c str>> arg 1 <integer_cst 0xb58ac168 constant invariant 0> arg 2 <integer_cst 0xb58ac168 0> arg 3 <integer_cst 0xb58ac1e0 1>>> -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27226