public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: kkaempf@progis.de
To: egcs@cygnus.com
Subject: egcs 2.91.14: packed-1 failure on openvms/alpha, more info
Date: Wed, 18 Mar 1998 14:08:00 -0000	[thread overview]
Message-ID: <19980318140040.1552.qmail@progis.de> (raw)

Looks like there is a bug in simplify_shift_const() (combine.c)
for mixed 32/64 bit targets.

It is called from alpha_expand_unaligned_load() in alpha/alpha.c
for the signed word case (see comment there).

Adding a bit of debug output reveals a wrong simplification

simplify_shift_const (code 81(ashiftrt), mode 6(DI), count 48)

x:	(ashiftrt:DI (and:DI (reg:DI 82)
	        (const_int -281474976710656 0xffff000000000000))
	    (const_int 48 0x30))

varop:	(and:DI (reg:DI 82)
	    (const_int -281474976710656 0xffff000000000000))

returns
 
	(ashiftrt:DI (reg:DI 82)
	    (const_int 63 0x3f))


So instead of removing the (unneeded) 'and' operation from the
ashiftrt operand, the shift count is set to the wrong value.

The code in question is at line 8338 in combine.c:

      /* If we are doing an arithmetic right shift and discarding all but
         the sign bit copies, this is equivalent to doing a shift by the
         bitsize minus one.  Convert it into that shift because it will often
         allow other simplifications.  */
      
      if (code == ASHIFTRT
          && (count + num_sign_bit_copies (varop, shift_mode)
              >= GET_MODE_BITSIZE (shift_mode)))
        count = GET_MODE_BITSIZE (shift_mode) - 1;
         
since num_sign_bit_copies() returns 16 and count is set to 63.

Klaus
-- 
proGIS Software                 E-Mail: kkaempf@progis.de
Dipl.-Inform. Klaus K"ampf      Fax:    0241-47067-29
Jakobstr. 117                   Voice:  0241-47067-11
D-52064 Aachen                  WWW:	http://www.progis.de


             reply	other threads:[~1998-03-18 14:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-18 14:08 kkaempf [this message]
1998-03-25 17:22 ` Jim Wilson
1998-03-27 15:18   ` Jeffrey A Law
1998-03-26 14:38     ` Jim Wilson
1998-03-26 18:14       ` Jeffrey A Law
1998-03-30 16:18         ` Richard Henderson
1998-03-30 16:18           ` Jeffrey A Law
1998-04-02 11:32   ` Jim Wilson

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=19980318140040.1552.qmail@progis.de \
    --to=kkaempf@progis.de \
    --cc=egcs@cygnus.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).