public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: William Tambe <tambewilliam@gmail.com>
To: gcc-help <gcc-help@gcc.gnu.org>
Subject: help removing unnecessary zero-extension
Date: Wed, 21 Sep 2022 16:57:39 -0500	[thread overview]
Message-ID: <CAF8i9mMcSaKEHWyCAB8r1PJFD4r9QiPB5uPoo9tvRmGL1geTEQ@mail.gmail.com> (raw)

Given following program:

    unsigned char var;
    int main() {
        return var;
    }

And compiled using:
pu32-elf-gcc -O3 -c -save-temps test.c

Unnecessary zero-extension gets generated after a memory byte load
which already zero-extend.

LOAD_EXTEND_OP has been defined as follow:
#define LOAD_EXTEND_OP(M) ZERO_EXTEND

Find complete port at:
https://github.com/fontamsoc/gcc/commit/45840063
And machine description at:
https://github.com/fontamsoc/gcc/blob/45840063/gcc/config/pu32/pu32.md

Any idea what else can be tried to prevent the unnecessary zero-extension ?

             reply	other threads:[~2022-09-21 21:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21 21:57 William Tambe [this message]
2022-09-22 13:17 ` Richard Sandiford

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=CAF8i9mMcSaKEHWyCAB8r1PJFD4r9QiPB5uPoo9tvRmGL1geTEQ@mail.gmail.com \
    --to=tambewilliam@gmail.com \
    --cc=gcc-help@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).