https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61320
--- Comment #19 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> --- > --- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> --- > (In reply to Eric Botcazou from comment #11) >> > So I am testing the patch right now and should be able to send it tomorrow. >> > However, the code already shall already mark the load with the actual >> > alignment the access is being done with. Therefore it seems to me that >> > something in the backend fails to split the unaligned load into several >> > aligned load. >> >> But what would be the point of this round trip exactly? > > I'd say > > Index: tree-ssa-math-opts.c > =================================================================== > --- tree-ssa-math-opts.c (revision 211170) > +++ tree-ssa-math-opts.c (working copy) > @@ -2149,7 +2149,8 @@ bswap_replace (gimple stmt, gimple_stmt_ > unsigned align; > > align = get_object_alignment (src); > - if (bswap && SLOW_UNALIGNED_ACCESS (TYPE_MODE (load_type), align)) > + if (align < GET_MODE_ALIGNMENT (TYPE_MODE (load_type)) > + && SLOW_UNALIGNED_ACCESS (TYPE_MODE (load_type), align)) > return false; > > /* Compute address to load from and cast according to the size > > is obvious (and pre-approved). I've now regtested that patch on sparc-sun-solaris2.11 (compared to a bootstrap without java before) and i386-pc-solaris2.11. No regressions, but gcc.c-torture/execute/bswap-2.c is still failing on sparc. Since it seems a non-workaround patch is now forthcoming, I'll hold off on installing it, but instead keep it local for the moment. Thanks. Rainer