public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* help removing unnecessary zero-extension
@ 2022-09-21 21:57 William Tambe
  2022-09-22 13:17 ` Richard Sandiford
  0 siblings, 1 reply; 2+ messages in thread
From: William Tambe @ 2022-09-21 21:57 UTC (permalink / raw)
  To: gcc-help

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 ?

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

end of thread, other threads:[~2022-09-22 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21 21:57 help removing unnecessary zero-extension William Tambe
2022-09-22 13:17 ` Richard Sandiford

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).