On Wed, Jan 4, 2012 at 5:24 PM, Eric Botcazou <ebotca...@adacore.com> wrote: >> OK. But passing small structures by value doesn't seem that rare -- >> especially in C++ -- and it doesn't feel right to disable SRA just because >> the backend likes to increase the alignment of stack vars. > > Agreed. > >> ...something like this sounds good, although you seem less than happy >> with it :-) > > Just not very comfortable with it, as we're walking a thin line. I've > attached > a more "dangerous" testcase that is now optimized again (and still works). > > Regtested on SPARC/Solaris. Can you confirm that this fixes the pessimization > in all cases (and run the C testsuite for your favorite ABI variant)? TIA.
Ok if it passes testing. Thanks, Richard. > > PR tree-optimization/51315 > * tree-sra.c (tree_non_aligned_mem_for_access_p): New predicate. > (build_accesses_from_assign): Use it instead of tree_non_aligned_mem_p. > > > * gcc.c-torture/execute/20120104-1.c: New test. > > > -- > Eric Botcazou