public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98953] New: Failure to optimize two reads from adjacent addresses into one
@ 2021-02-03 14:55 gabravier at gmail dot com
  2021-02-04  7:42 ` [Bug tree-optimization/98953] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gabravier at gmail dot com @ 2021-02-03 14:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98953

            Bug ID: 98953
           Summary: Failure to optimize two reads from adjacent addresses
                    into one
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

int f(uint8_t *read, size_t abs)
{
    return read[abs] + 0x100 * read[abs + 1];;
}

This can be optimized to (ignoring aliasing) `return *(uint16_t *)(read +
abs)`. This transformation is done by LLVM, but not by GCC.

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

end of thread, other threads:[~2024-01-14 21:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 14:55 [Bug tree-optimization/98953] New: Failure to optimize two reads from adjacent addresses into one gabravier at gmail dot com
2021-02-04  7:42 ` [Bug tree-optimization/98953] " rguenth at gcc dot gnu.org
2021-07-28 21:27 ` pinskia at gcc dot gnu.org
2021-11-22  8:44 ` roger at nextmovesoftware dot com
2021-11-22 18:17 ` cvs-commit at gcc dot gnu.org
2021-11-25 20:05 ` roger at nextmovesoftware dot com
2021-12-15 23:31 ` pinskia at gcc dot gnu.org
2024-01-14 21:44 ` [Bug tree-optimization/98953] Failure to optimize two reads from adjacent addresses into one due to having an offset (index) pinskia 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).