From: Mikael Pettersson <mikpelinux@gmail.com>
To: gcc@gcc.gnu.org
Cc: Anthony Green <green@moxielogic.com>
Subject: oddities in the moxie gcc backend
Date: Sun, 15 Jan 2017 14:03:00 -0000 [thread overview]
Message-ID: <22651.33042.461176.548948@gargle.gargle.HOWL> (raw)
I have a toy backend based on the moxie backend as a template. During its
development I found some oddities in the moxie backend that may be bugs.
1. The REGNO_OK_FOR_INDEX_P(NUM) macro in moxie.h is:
#define REGNO_OK_FOR_INDEX_P(NUM) MOXIE_FP
Since MOXIE_FP is 0, this returns false for every register. Should the body
be a literal 0, or some comparison between NUM and MOXIE_FP?
2. I see no actual use of MOXIE_PC or the SPECIAL_REGS register class. Could they
be deleted (with adjustments for decrementing MOXIE_CC)?
3. moxie_compute_frame () doesn't take !fixed_regs[regno] into account, which the
related loops in moxie_expand_prologue () and moxie_expand_epilogue () do. Bug?
There are also some minor nits:
4. The comment above `size_for_adjusting_sp' states it's used in expand_epilogue(),
which it isn't.
5. The "Compute this since .." comment in moxie_initial_elimination_offset () should
probably refer to callee_saved_reg_size not local_vars_size, to match the code.
6. There are two idential definitions of TRULY_NOOP_TRUNCATION(op,ip) in moxie.h.
The first one looks misplaced and should probably be deleted.
/Mikael
next reply other threads:[~2017-01-15 14:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-15 14:03 Mikael Pettersson [this message]
2017-01-16 13:33 ` Anthony Green
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=22651.33042.461176.548948@gargle.gargle.HOWL \
--to=mikpelinux@gmail.com \
--cc=gcc@gcc.gnu.org \
--cc=green@moxielogic.com \
/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).