[U-Boot] fdt performance

Wolfgang Denk wd at denx.de
Mon Oct 21 21:55:23 CEST 2013


Dear Michael,

In message <CAPx6ZwHLn-VABzQOyAMF+T2VyQEc3MZDi1E_kdTVZG8OkJmBYA at mail.gmail.com> you wrote:
>
> > > it's possible that these checks could be simply optimised away. The
> >
> > This is not hwat happens.
> 
> Actually, it is my understanding that the "if (p + len < p)" can be
> optimized away.  This exact case is discussed in the LWN article "GCC and
> pointer overflows"[1].

No, this does not apply here.  You miss a key point.  We are not doing
any pointer arithmetics here.  We have:

	int offset;
	unsigned int len;

and then do:

	if (((offset + len) < offset) ...) ...

> Basically, the C standard states that pointer arithmetic should not cause
> overflow, thus allowing the compiler to assume that "p + len" must always
> be greater than "p".

This is totally irrelevant here.  There are no pointers being used
here.

> --001a1133769056575204e93035f1
> Content-Type: text/html; charset=UTF-8
> Content-Transfer-Encoding: quoted-printable

Can you please stop posting HTML?  Thanks!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The human race is faced with a cruel choice: work  or  daytime  tele-
vision.


More information about the U-Boot mailing list