public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "law at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
Date: Tue, 17 Aug 2021 06:15:11 +0000	[thread overview]
Message-ID: <bug-101697-4-UyKAz7HqxH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101697-4@http.gcc.gnu.org/bugzilla/>

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |law at gcc dot gnu.org
   Last reconfirmed|                            |2021-08-17

--- Comment #4 from Jeffrey A. Law <law at gcc dot gnu.org> ---
I've managed to reproduce.  It's possible I was missing the -fno-builtin on my
command line.

A much simplified testcase:
struct gaih_servtuple
{
  struct gaih_servtuple *next;
};


int
gaih_inet (const char *name,  const void *req)
{
  struct gaih_servtuple *st;
  int *tp;
  if (req)
    ++tp;

  struct gaih_servtuple **pst = &st;
  while (1)
    {
      struct gaih_servtuple *newp;


      newp = __builtin_alloca (sizeof (struct gaih_servtuple));
      frob (name, tp, req, newp);
      *pst = newp;
      pst = &(newp->next);
      tp++;
    }
}

We're fine up to and including IRA.
(insn 20 18 22 5 (set (reg/f:SI 28)
        (reg/f:SI 7 sp)) "k.c":21:14 19 {*movsi}
     (nil))
(insn 22 20 23 5 (set (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [1  S4 A32])
        (reg/f:SI 28)) "k.c":22:7 19 {*movsi}
     (expr_list:REG_ARGS_SIZE (const_int 4 [0x4])
        (nil)))

And IRA allocates hard reg #6 for pseudo #28, which is also fine.

Reload reports:
Reload 1: reload_in (SI) = (reg/f:SI 28)
        GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 1)
        reload_in_reg: (reg/f:SI 28)
        reload_reg_rtx: (reg/f:SI 7 sp)

Which is not good as replacing (reg 28) with (reg sp) is not valid.

I haven't tried converting the H8 to LRA yet, which would be the ultimate
solution if it worked.  Ideally any port not converted to LRA ought to be
flagged as deprecated for gcc-12 and dropped if not fixed by gcc-13.

  parent reply	other threads:[~2021-08-17  6:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 18:37 [Bug target/101697] New: " mikpelinux at gmail dot com
2021-07-30 18:47 ` [Bug target/101697] " pinskia at gcc dot gnu.org
2021-07-31 21:09 ` mikpelinux at gmail dot com
2021-08-03 17:02 ` law at gcc dot gnu.org
2021-08-09 20:26 ` mikpelinux at gmail dot com
2021-08-17  6:15 ` law at gcc dot gnu.org [this message]
2021-08-17  6:15 ` law at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2022-10-16 19:19 ` [Bug target/101697] [11/12/13 " law at gcc dot gnu.org
2022-10-17 23:54 ` cvs-commit at gcc dot gnu.org
2022-10-17 23:55 ` [Bug target/101697] [11/12 " law at gcc dot gnu.org
2022-10-18 14:39 ` mikpelinux at gmail dot com
2022-12-19 21:59 ` pinskia at gcc dot gnu.org
2023-02-23 23:10 ` pinskia at gcc dot gnu.org

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-101697-4-UyKAz7HqxH@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).