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

Re: Warning: Immediates 21 and 32 will give undefined behavior.



On Fri, 31 Jul 2009, Carlos O'Donell wrote:

> On Fri, Jul 31, 2009 at 10:26 AM, Frans Pop<elendil@planet.nl> wrote:
> > During compilations using gcc-4.3 of the upstream 2.6.31-rc4 kernel, I
> > twice noticed the warning below. As the compilation was done with '-j4',
> > I'm not sure what code causes it. I'm also not sure if the example below
> > is the same as the first time I saw it.
> >
> > Is this something to worry about, or to ignore?
> >
> > The kernel config was 64-bits SMP.

The problem is believed to be fixed in the GCC trunk, 4.3 and 4.4
branches.  It is not fixed in any released version of GCC.  Helge
reported this a couple of weeks ago.

GCC loads various constants with depwi and depdi.  The deposit length
was wrong.

I believe the error occurs compiling nls_base.c.  The constant that
generated the message was -10240 (0xffffd800).

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.  He developed the assembler check.

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.

There are other situations where depwi and depdi are used in GCC, but
I haven't seen any of these warnings.  If you see warnings in other
situations, I will fix GCC.  Most wrong code problems are simple to fix.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)


Reply to: