public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52640] New: performance bottleneck: gcc/tree.c;value_member
@ 2012-03-20 18:36 ncahill_alt at yahoo dot com
  2012-03-21  0:04 ` [Bug c/52640] " jan.smets@alcatel-lucent.com
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: ncahill_alt at yahoo dot com @ 2012-03-20 18:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52640

             Bug #: 52640
           Summary: performance bottleneck: gcc/tree.c;value_member
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ncahill_alt@yahoo.com


Created attachment 26935
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26935
source, output, profiling data indicating problem

It was made known to me that the code provided takes a long time to compile. 
Looking into it, the culprit seems to be the value_member function of
gcc/tree.c.  Here is that code (preprocessed):

####
tree value_member (tree elem, tree list)
{
    while (list) 
    {
        if (elem == ((list)->list.value))
            return list;
        list = ((list)->common.chain);
    }
    return (tree) ((void *)0);
}
####

A sample of profiling data, from OProfile and using gcc 4.6.2:

####
samples  %        image name               symbol name
19955    43.1814  cc1                      value_member
1179      2.5513  cc1                      record_reference
1122      2.4279  cc1                      insert_aux

####

With a table of 10000 rows, it takes ~40% of the execution time, and with
200000 rows, ~90%.  The former takes 5 seconds, the later is not finished in 20
minutes.

Provided is a sample source file with output from cc1 and profiling data as
above.

Thank you.
Neil.


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-12-12  9:45 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20 18:36 [Bug c/52640] New: performance bottleneck: gcc/tree.c;value_member ncahill_alt at yahoo dot com
2012-03-21  0:04 ` [Bug c/52640] " jan.smets@alcatel-lucent.com
2012-03-21  0:44 ` steven at gcc dot gnu.org
2012-03-21 13:02 ` steven at gcc dot gnu.org
2012-03-21 13:03 ` steven at gcc dot gnu.org
2012-03-21 13:10 ` steven at gcc dot gnu.org
2012-03-21 15:57 ` jan.smets@alcatel-lucent.com
2012-03-21 16:21 ` steven at gcc dot gnu.org
2012-03-21 18:37 ` ncahill_alt at yahoo dot com
2012-03-21 18:37 ` [Bug middle-end/52640] [4.5/4.6/4.7/4.8 Regression] " steven at gcc dot gnu.org
2012-03-21 20:25 ` jan.smets@alcatel-lucent.com
2012-03-24 13:48 ` steven at gcc dot gnu.org
2012-03-24 13:49 ` steven at gcc dot gnu.org
2012-03-24 13:52 ` steven at gcc dot gnu.org
2012-03-24 14:48 ` [Bug middle-end/52640] [4.8 " steven at gcc dot gnu.org
2012-07-02 13:52 ` rguenth at gcc dot gnu.org
2012-09-07 11:11 ` rguenth at gcc dot gnu.org
2012-09-07 19:07 ` stevenb.gcc at gmail dot com
2012-12-11  8:04 ` jakub at gcc dot gnu.org
2012-12-11  9:59 ` rguenth at gcc dot gnu.org
2012-12-11 16:56 ` jan.smets@alcatel-lucent.com
2012-12-11 17:06 ` jakub at gcc dot gnu.org
2012-12-12  9:44 ` jakub at gcc dot gnu.org
2012-12-12  9:45 ` jakub at gcc dot gnu.org

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).