mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: GCC 4.x random code generator for x86_64 ?
Date: Tue, 8 Dec 2009 00:09:31 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.0912072150450.3089@localhost.localdomain> (raw)
In-Reply-To: <20091207181301.GQ22813@hs20-bc2-1.build.redhat.com>

On Mon, 7 Dec 2009, Jakub Jelinek wrote:
> On Mon, Dec 07, 2009 at 06:50:17PM +0100, Thomas Gleixner wrote:
> > Can anyone shed some light on the following:
> > 
> > Applying a patch which adds a yet unused "extern int bla(void);" line
> > to a header file results in something which is beyond me.
> > 
> > The .i files differ as expected in exaclty _one_ line.
> 
> The source code is different, so this doesn't seem to be random code
> generation.  The extra declaration means following decls will have higher
> uids and there is a bunch of places in gcc where hash tables are traversed
> and code generation depends on the order in the traversal.  While hash
> tables hashed on pointer values are considered important bugs because
> generated code could change in between runs with the same source, traversal
> of tables hashed by decl uids are far less severe - gcc makes no promises
> that different sources result in the same generated code.

Sorry, I do not consider that delta an effective code change and I
don't think that the "no promise" answer is a good explanation for
generated code which is randomly different and in some places worse
for no good reason.

We often use(d) binary comparisions to verify that an assumed zero
change patch actually does what it promises. That way we verified the
bulk of the i386/x86_64 code move and I never saw such odd behaviour
back then (the deltas were way larger than that single line change).

> You are using quite oldish gcc, if you reproduce it with something newer

I was compiling 2.6.32 which is quite oldish code. That deserves an
quite oldish compiler. :)

Seriously, the gcc I'm using is shipped with F11 and that's what a lot
of people (still) have on their machines.

> (current 4.5 trunk or recent gcc from redhat/gcc-4_4-branch) and provide
> full preprocessed source and exact command line options, I'll have a look
> though.

F12 gcc [(GCC) 4.4.2 20091027 (Red Hat 4.4.2-7)] has similar
randomization. I'll send you the preprocessed source + command line
options tomorrow.

The current 4.5 trunk creates identical binary files with and without
the patch.

Thanks,

	tglx

      reply	other threads:[~2009-12-07 23:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 17:50 Thomas Gleixner
2009-12-07 18:13 ` Jakub Jelinek
2009-12-07 23:09   ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0912072150450.3089@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=hpa@zytor.com \
    --cc=jakub@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®