public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amylaar at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/60749] New: combine is overly cautious when operating on volatile memory references
Date: Thu, 03 Apr 2014 15:41:00 -0000	[thread overview]
Message-ID: <bug-60749-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 60749
           Summary: combine is overly cautious when operating on volatile
                    memory references
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amylaar at gcc dot gnu.org
            Blocks: 53938

Curtesy of volatile_ok / init_recog_no_volatile, combine will
reject any combination that involves a volatile memref in the combined
pattern.

In particular, if any narrow memory location is read on a
WORD_REGISTER_OPERATIONS target, the zero/sign extension can't be combined
with a memory read, even if a suitably extending memory load instruction is
available - unless that pattern gets specifically written to accept
volatile memrefs, shunning the standard memory_operand and
general_operand predicates.

combine already needs to do special checks to make sure it doesn't
slip up when handling such patterns (E.g. see PR51374), so what good
does init_recog_non_volatile do combine these days?

At the very least, I think we should allow combinations involving a single
memref with unchanged mode before and after combination - that woud cover
the zero and sign extending loads.


             reply	other threads:[~2014-04-03 15:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03 15:41 amylaar at gcc dot gnu.org [this message]
2022-02-04 20:55 ` [Bug rtl-optimization/60749] " pinskia at gcc dot gnu.org
2023-05-26 13:56 ` lis8215 at gmail dot com
2023-09-25  7:09 ` cptarse-luke at yahoo dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60749-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).