[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#539470: Warning: Immediates 21 and 32 will give undefined behavior.



Package: gcc-4.3
Tags: upstream, patch

I'm filing this BR against gcc-4.3, but according to upstream it affects
*all* versions of gcc, and in all Debian releases!

During compilations using gcc-4.3 of the upstream 2.6.31-rc4 kernel, I
twice noticed the following warning:
{standard input}: Assembler messages:
{standard input}:1345: Warning: Immediates 21 and 32 will give undefined behavior.

John David Anglin responded:
   GCC loads various constants with depwi and depdi. The deposit length was
   wrong. Helge found that a 715 failed to boot because some hand written
   assembler code had an incorrect deposit length. Thus, he believes that
   it is an issue to worry about on old machines.
   It is not a new issue. The responsible GCC code had not changed since
   1997. So, maybe it is not a problem on most PA machines.

A patch has been committed to upstream GCC trunk, 4.3 and 4.4 branches, but
not yet released:
2009-07-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
        * pa.c (compute_zdepwi_operands): Limit deposit length to 32 - lsb.
        Cast "1" to unsigned HOST_WIDE_INT.
        (compute_zdepdi_operands): Limit maximum length to 64 bits.  Limit
        deposit length to the maximum length - lsb.  Extend length if
        HOST_BITS_PER_WIDE_INT is 32.

For details, see the following thread on the d-hppa list:
http://lists.debian.org/debian-hppa/2009/07/msg00093.html

For questions I suggest you contact John David Anglin or Carlos O'Donell.

Cheers,
FJP



Reply to: