public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/53535] New: non-aligned memset on non-strict-alignment targets not optimized where aligned memset is
@ 2012-05-31  4:30 hp at gcc dot gnu.org
  2012-05-31  4:32 ` [Bug middle-end/53535] " hp at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hp at gcc dot gnu.org @ 2012-05-31  4:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53535

             Bug #: 53535
           Summary: non-aligned memset on non-strict-alignment targets not
                    optimized where aligned memset is
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hp@gcc.gnu.org
            Target: x86_64-linux


The attached code is a modified gcc.dg/pr46647.c, which shows that memset isn't
optimized on unaligned short (int-sized) data as it is for aligned data, even
for non-strict-alignment targets, such as cris-* and x86_64-linux. Observe the
emitted assembly code, which uses the same instructions for aligned and
unaligned code as later optimizations cover up (for both cris-* and
x86_64-linux). Hence, I guess this bug isn't really that important when it
comes to just the generated code, just an annoying middle-end miss and
annoyingly failing test-case.  (Whether the over-alignment-checks misses other
optimization opportunities is another issue.)

Background: I stumbled upon this when changing the CRIS port to align global
data by default. This made the always-before-failing gcc.dg/pr46647.c pass, for
no good reason: alignment of data should not make a difference for emitted code
(except for atomic support, WIP for CRIS).

This may be related to PR 52861.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-21 18:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-31  4:30 [Bug middle-end/53535] New: non-aligned memset on non-strict-alignment targets not optimized where aligned memset is hp at gcc dot gnu.org
2012-05-31  4:32 ` [Bug middle-end/53535] " hp at gcc dot gnu.org
2012-05-31  4:37 ` pinskia at gcc dot gnu.org
2012-05-31  4:40 ` hp at gcc dot gnu.org
2012-05-31  4:43 ` [Bug middle-end/53535] non-aligned memset on non-strict-alignment !SLOW_UNALIGNED_ACCESS " hp at gcc dot gnu.org
2012-05-31  7:09 ` [Bug middle-end/53535] non-aligned memset on non-strict-alignment " hp at gcc dot gnu.org
2012-06-07 20:44 ` hp at gcc dot gnu.org
2022-05-21 18:35 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).