public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* egcs 2.91.14: packed-1 failure on openvms/alpha, more info
@ 1998-03-18 14:08 kkaempf
  1998-03-25 17:22 ` Jim Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: kkaempf @ 1998-03-18 14:08 UTC (permalink / raw)
  To: egcs

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


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

end of thread, other threads:[~1998-04-02 11:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-18 14:08 egcs 2.91.14: packed-1 failure on openvms/alpha, more info kkaempf
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

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