> From: Richard Biener [mailto:richard.guent...@gmail.com] > > Agreed, but I am happy with doing that as a followup. Btw, > a very simple one would be to reject unaligned > SLOW_UNALIGNED_ACCESS (TYPE_MODE (load_type), align). > [of course that may be true on MIPS even for the cases where > a "reasonable" fast unalgined variant exists - nearly no target > defines that macro in a too fancy way]
Indeed, it's defined to 1 without consideration of the mode or alignment At least ARM, alpha, tilegx, tilepro and all target with STRICT_ALIGNMENT since that's the default value for SLOW_UNALIGNED_ACCESS macro. Thus mips should be in there too for instance. However, I fail to see how the code produced to do an unaligned load could be worse than the manual load done in the original bitwise expression. It might be worse for load + bswap though. Maybe I could skip the optimization based on this macro only for bswap? Best regards, Thomas