public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <Ulrich.Weigand@de.ibm.com>
To: dpitts@cozx.com
Cc: gcc@gcc.gnu.org
Subject: Re: Optimizer questions/issues with EBCDIC i370/s390 modes.
Date: Thu, 22 Aug 2002 10:21:00 -0000	[thread overview]
Message-ID: <OFE2DE7EE5.0BD95E48-ONC1256C1D.005DB73B@de.ibm.com> (raw)

Dave Pitts wrote:

>The error seems to point at the sdiv_qrnnd macro:

However, that macro looks perfectly OK to me, and in fact it works
on s390.

>../../gcc-3.2/gcc/libgcc2.c: In function `__udiv_w_sdiv':
>../../gcc-3.2/gcc/libgcc2.c:403: `asm' operand requires impossible reload
>../../gcc-3.2/gcc/libgcc2.c:427: `asm' operand requires impossible reload

I've checked this with a cross-compiler to i370-ibm-openedition,
and get the same error.  This appears to be caused by a problem
in the i370 backend.

What happens is that the compiler generates a DImode reload insn of the
form
  (set (reg:DI 0) (reg:DI 49))
for a pseudo 49, which gets assigned a stack slot.

This insn is then rejected by the backend as invalid, which is a bug
in the backend, as any move insn must be valid.

The problem is that the reg:DI 49 operand matches a r_or_s_operand
predicate (because it's a REG), therefore the insn matches this pattern:

  [(set (match_operand:DI 0 "r_or_s_operand" "=dS,m")
        (match_operand:DI 1 "r_or_s_operand" "diS*fF,d*fF"))]

However, as the pseudo was allocated a stack slot, it matches neither
the diS*fF nor the d*fF constraint in strict mode and is thus rejected.
This needs to be fixed; for a move pattern, the constraints need to accept
anything allowed by the predicate (and the predicate really should be
general_operand anyway).  (For other patterns, this requirement is not
quite that strict as reload can fix things up, but for moves, reload
relies on the backend to accept basically anything.)


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com

             reply	other threads:[~2002-08-22 10:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-22 10:21 Ulrich Weigand [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-08-22  8:48 Ulrich Weigand
2002-08-22  9:05 ` Dave Pitts
2002-08-21 13:51 Dave Pitts
2002-08-21 14:12 ` David Edelsohn
2002-08-21 16:58   ` Dave Pitts
2002-08-21 19:03     ` David Edelsohn
2002-08-22  7:41   ` Kaveh R. Ghazi
2002-08-22  8:11     ` Dave Pitts
2002-08-22  8:15       ` Dave Pitts
2002-08-22  8:27         ` Kaveh R. Ghazi
2002-08-22  8:31           ` Dave Pitts

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=OFE2DE7EE5.0BD95E48-ONC1256C1D.005DB73B@de.ibm.com \
    --to=ulrich.weigand@de.ibm.com \
    --cc=dpitts@cozx.com \
    --cc=gcc@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).