[Bug tree-optimization/52402] IPA-SRA creates aligned loads from unaligned memory

2012-02-27 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52402

--- Comment #1 from Richard Guenther  2012-02-27 
15:28:46 UTC ---
err, forgot the packed attribute on the struct.


[Bug tree-optimization/52402] IPA-SRA creates aligned loads from unaligned memory

2012-02-27 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52402

Richard Guenther  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2012-02-27
 AssignedTo|unassigned at gcc dot   |rguenth at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1
  Known to fail||4.6.2, 4.7.0

--- Comment #2 from Richard Guenther  2012-02-27 
15:31:56 UTC ---
I have a patch.  A regression from before IPA SRA was introduced.


[Bug tree-optimization/52402] IPA-SRA creates aligned loads from unaligned memory

2012-02-28 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52402

Richard Guenther  changed:

   What|Removed |Added

  Known to work||4.7.0
  Known to fail|4.7.0   |

--- Comment #4 from Richard Guenther  2012-02-28 
09:16:20 UTC ---
Fixed on trunk sofar.


[Bug tree-optimization/52402] IPA-SRA creates aligned loads from unaligned memory

2012-02-28 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52402

--- Comment #3 from Richard Guenther  2012-02-28 
09:15:54 UTC ---
Author: rguenth
Date: Tue Feb 28 09:15:49 2012
New Revision: 184619

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184619
Log:
2012-02-28  Richard Guenther  

PR tree-optimization/52402
* ipa-prop.c (ipa_modify_call_arguments): Properly use
mis-aligned types when creating the accesses at the call site.

* gcc.dg/torture/pr52402.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr52402.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-prop.c
trunk/gcc/testsuite/ChangeLog


[Bug tree-optimization/52402] IPA-SRA creates aligned loads from unaligned memory

2013-07-30 Thread amylaar at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52402

Jorn Wolfgang Rennecke  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  ---
(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)
 
unit size 
align 32 symtab 0 alias set 3 canonical type 0xb7bed360 precision 32
min  max 
pointer_to_this >
TI
size 
constant 128>
unit size 
constant 16>
align 64 symtab 0 alias set 3 canonical type 0xb7c5f960 nunits 4 context

pointer_to_this >

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)
 
unit size 
align 32 symtab 0 alias set 3 canonical type 0xb7bed360 precision 32
min  max 
pointer_to_this >
TI
size 
constant 128>
unit size 
constant 16>
align 8 symtab 0 alias set -1 canonical type 0xb7c5f960 nunits 4 context
>

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.


[Bug tree-optimization/52402] IPA-SRA creates aligned loads from unaligned memory

2013-08-27 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52402

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to fail|4.8.1, 4.9.0|

--- Comment #6 from Richard Biener  ---
So you say that on Epiphany the ABI of the function depends on the actual
argument alignment?  And this alignment is taken from the _argument_, not
the type of the function prototype?

Thus, if you call foo () at one point with an aligned T and at one point
with an unaligned T then ... what?

It seems to me the Epiphany port uses disconnected information at
call-site vs. function prologue.

[this ought to have been a new bugreport instead of hijacking the old one]

Marking the old one as fixed (4.6 is closed now).  Please open a new bug.