This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/52402] IPA-SRA creates aligned loads from unaligned memory
- From: "amylaar at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Jul 2013 10:58:19 +0000
- Subject: [Bug tree-optimization/52402] IPA-SRA creates aligned loads from unaligned memory
- Auto-submitted: auto-generated
- References: <bug-52402-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52402
Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amylaar at gcc dot gnu.org
Known to fail| |4.8.1, 4.9.0
--- Comment #5 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #4)
> Fixed on trunk sofar.
What I see on epiphany (at O2 and above, enabling SRA) for
gcc.dg/torture/pr52402.c is that the call of foo.isra.0 in main is done
using an aligned type:
Breakpoint 5, epiphany_function_arg (cum_v=..., mode=TImode, type=0xb7c5f960,
named=true)
at /home/amylaar/adapteva/git/sdk/srcw/gcc/config/epiphany/epiphany.c:2177
2177 CUMULATIVE_ARGS cum = *get_cumulative_args (cum_v);
(gdb) call debug_tree(type)
<vector_type 0xb7c5f960
type <integer_type 0xb7bed360 int public SI
size <integer_cst 0xb7bdd104 constant 32>
unit size <integer_cst 0xb7bdd118 constant 4>
align 32 symtab 0 alias set 3 canonical type 0xb7bed360 precision 32
min <integer_cst 0xb7bdd2f8 -2147483648> max <integer_cst 0xb7bdd30c
2147483647>
pointer_to_this <pointer_type 0xb7beda80>>
TI
size <integer_cst 0xb7bdd460 type <integer_type 0xb7bed060 bitsizetype>
constant 128>
unit size <integer_cst 0xb7bdd474 type <integer_type 0xb7bed000 sizetype>
constant 16>
align 64 symtab 0 alias set 3 canonical type 0xb7c5f960 nunits 4 context
<translation_unit_decl 0xb7bf2e58 D.1323>
pointer_to_this <pointer_type 0xb7c5fba0>>
but when the callee foo.isra.0 was compiled before, it got allegedly passed
an unaligned type:
Breakpoint 5, epiphany_function_arg (cum_v=..., mode=TImode, type=0xb7c6f300,
named=true)
at /home/amylaar/adapteva/git/sdk/srcw/gcc/config/epiphany/epiphany.c:2177
2177 CUMULATIVE_ARGS cum = *get_cumulative_args (cum_v);
(gdb) call debug_tree(type)
<vector_type 0xb7c6f300 v4si
type <integer_type 0xb7bed360 int public SI
size <integer_cst 0xb7bdd104 constant 32>
unit size <integer_cst 0xb7bdd118 constant 4>
align 32 symtab 0 alias set 3 canonical type 0xb7bed360 precision 32
min <integer_cst 0xb7bdd2f8 -2147483648> max <integer_cst 0xb7bdd30c
2147483647>
pointer_to_this <pointer_type 0xb7beda80>>
TI
size <integer_cst 0xb7bdd460 type <integer_type 0xb7bed060 bitsizetype>
constant 128>
unit size <integer_cst 0xb7bdd474 type <integer_type 0xb7bed000 sizetype>
constant 16>
align 8 symtab 0 alias set -1 canonical type 0xb7c5f960 nunits 4 context
<translation_unit_decl 0xb7bf2e58 D.1323>>
When passing 64-bit aligned types, the epiphany ABI uses register pair(s)
to enable double load-store, thus in this case where r0 has already been
used, the argument starts at r2; in the less-aligned case, it starts at
r1. Thus, the callee expects the argument in a different place than where
it has been put by the caller.