lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1725EF63@AcuExch.aculab.com>
Date:	Thu, 19 Jun 2014 08:13:48 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Tejun Heo' <tj@...nel.org>
CC:	'Alexei Starovoitov' <alexei.starovoitov@...il.com>,
	Daniel Borkmann <dborkman@...hat.com>,
	"davem@...emloft.net" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-sctp@...r.kernel.org" <linux-sctp@...r.kernel.org>
Subject: RE: [PATCH net-next 5/5] net: sctp: fix incorrect type in gfp
 initializer

From: Tejun Heo
> On Thu, Jun 12, 2014 at 08:46:44AM +0000, David Laight wrote:
> > I was slightly worried it might generate the boolean value - something
> > that you really don't want it to do.
> 
> I don't think gcc is that stupid at this point.
> 
> > I only looked at the output for the old version.
> > The compiler seemed to have converted:
> > 	if (preload)
> > 		x();
> > 	y;
> > 	if (preload)
> > 		z();
> > into:
> > 	if (preload) {
> > 		x(); y; z();
> > 	} else {
> > 		y;
> > 	}
> > and then found out that z() was empty, leaving two copies of y().
> 
> So, nothing wrong, right?

Apart from the fact that it is badly optimised.

If z() were an empty #define rather than an empty inline function
then you'd end up with the:
	if (preload)
		z();
being completely optimised away.

	David



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ