From: Ian Lance Taylor <iant@google.com>
To: sje@cup.hp.com
Cc: gcc-patches@gcc.gnu.org, andreasmeier80@gmx.de
Subject: Re: Patch for PR tree-optimization/32941, bootstrap comparision failure
Date: Fri, 10 Aug 2007 16:33:00 -0000 [thread overview]
Message-ID: <m38x8j9wx0.fsf@localhost.localdomain> (raw)
In-Reply-To: <200708101549.IAA02582@hpsje.cup.hp.com>
Steve Ellcey <sje@cup.hp.com> writes:
> This patch fixes PR tree-optimization/32941, a bootstrap comparision
> failure. Currently we sort the goto_queue in tree-eh.c using qsort and
> search it with bsearch. Because qsort is an unstable sort and we are
> sorting on addresses we can get different orderings during different
> bootstrap passes, resulting in the comparision failure.
>
> This patch removes the sort and replaces the bsearch call with a simple
> linear search. The obvious concern with this is compile time
> performance but during a bootstrap the largest size goto_queue I saw was
> 7 elements and while compiling the C++ SPEC2006 benchmarks, the largest
> size I saw was 30.
>
> Given these relatively small sizes for the goto_queue, I think using a
> linear search will not result in any compile time change or may actually
> be faster since 99% of the time we search the queue the size is 1.
I don't think this is a good idea. I think it will significantly hurt
compiler time performance on some machine generated C++ code.
I think the idea of not sorting the queue makes sense. I just think
we need to augment your patch by adding a pointer_map which maps from
statements to queue elements. That is, maybe_record_in_goto_queue
will call pointer_map_insert with STMT, and find_goto_replacement will
call pointer_map_contains.
Ian
next prev parent reply other threads:[~2007-08-10 16:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-10 15:50 Steve Ellcey
2007-08-10 16:33 ` Ian Lance Taylor [this message]
2007-08-10 16:39 ` Diego Novillo
2007-08-10 21:45 ` Daniel Berlin
2007-08-10 21:58 ` Steve Ellcey
2007-08-10 22:05 ` Daniel Berlin
2007-08-10 22:18 ` Steve Ellcey
2007-08-10 22:00 ` Diego Novillo
2007-08-13 17:18 Steve Ellcey
2007-08-13 17:50 ` Ian Lance Taylor
2007-08-14 17:25 ` Steve Ellcey
2007-08-14 18:03 ` Steve Ellcey
2007-08-14 14:15 ` Diego Novillo
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=m38x8j9wx0.fsf@localhost.localdomain \
--to=iant@google.com \
--cc=andreasmeier80@gmx.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=sje@cup.hp.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).