public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/37171]  New: [4.4 Regression] Canonical spelling optimization dependency
@ 2008-08-20  2:25 dje at gcc dot gnu dot org
  2008-08-20  2:26 ` [Bug regression/37171] " dje at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: dje at gcc dot gnu dot org @ 2008-08-20  2:25 UTC (permalink / raw)
  To: gcc-bugs

The recent patch

        * c-parser.c (c_lex_one_token): Do not store the canonical spelling
        for keywords.

causes a significant performance regression on SPEC CPU2000 197.parser.  With
the above patch, the libc function __ctype_b_loc is called significantly more
times, spending twice the number of cycles in that function.  Profiling shows
94K hits for fast version and 190K hits for slow version.

We suspect that this may involve the toupper() calls in strncasecmp.c. 
Apparently the canonical name is necessary for some GCC optimization, possibly
the automatic substitution of builtins.


-- 
           Summary: [4.4 Regression] Canonical spelling optimization
                    dependency
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dje at gcc dot gnu dot org
 GCC build triplet: powerpc*-*-*
  GCC host triplet: powerpc*-*-*
GCC target triplet: powerpc*-*-*


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


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

* [Bug regression/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
@ 2008-08-20  2:26 ` dje at gcc dot gnu dot org
  2008-08-20  9:42 ` [Bug c/37171] " rguenth at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dje at gcc dot gnu dot org @ 2008-08-20  2:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dje at gcc dot gnu dot org  2008-08-20 02:25 -------
confirmed


-- 

dje at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-08-20 02:25:37
               date|                            |


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
  2008-08-20  2:26 ` [Bug regression/37171] " dje at gcc dot gnu dot org
@ 2008-08-20  9:42 ` rguenth at gcc dot gnu dot org
  2008-08-20  9:42 ` [Bug regression/37171] " rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-08-20  9:42 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|regression                  |c
   Target Milestone|---                         |4.4.0


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


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

* [Bug regression/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
  2008-08-20  2:26 ` [Bug regression/37171] " dje at gcc dot gnu dot org
  2008-08-20  9:42 ` [Bug c/37171] " rguenth at gcc dot gnu dot org
@ 2008-08-20  9:42 ` rguenth at gcc dot gnu dot org
  2008-08-20 14:05 ` [Bug c/37171] " luisgpm at linux dot vnet dot ibm dot com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-08-20  9:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-08-20 09:41 -------
Interesting.  Can you attach preprocessed source?  I suspect this bug may
show/hide based on libc implementation details (toupper can be a macro).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-08-20  9:42 ` [Bug regression/37171] " rguenth at gcc dot gnu dot org
@ 2008-08-20 14:05 ` luisgpm at linux dot vnet dot ibm dot com
  2008-08-20 14:06 ` luisgpm at linux dot vnet dot ibm dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: luisgpm at linux dot vnet dot ibm dot com @ 2008-08-20 14:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from luisgpm at linux dot vnet dot ibm dot com  2008-08-20 14:04 -------
Created an attachment (id=16109)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16109&action=view)
Preprocessed source for the bad case


-- 


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-08-20 14:05 ` [Bug c/37171] " luisgpm at linux dot vnet dot ibm dot com
@ 2008-08-20 14:06 ` luisgpm at linux dot vnet dot ibm dot com
  2008-08-20 14:08 ` luisgpm at linux dot vnet dot ibm dot com
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: luisgpm at linux dot vnet dot ibm dot com @ 2008-08-20 14:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from luisgpm at linux dot vnet dot ibm dot com  2008-08-20 14:05 -------
Created an attachment (id=16110)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16110&action=view)
Preprocessed source for the good case


-- 


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-08-20 14:06 ` luisgpm at linux dot vnet dot ibm dot com
@ 2008-08-20 14:08 ` luisgpm at linux dot vnet dot ibm dot com
  2008-08-20 14:09 ` luisgpm at linux dot vnet dot ibm dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: luisgpm at linux dot vnet dot ibm dot com @ 2008-08-20 14:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from luisgpm at linux dot vnet dot ibm dot com  2008-08-20 14:06 -------
Created an attachment (id=16111)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16111&action=view)
Generated ASM code for the bad case

Notice that __ctype_toupper_loc is called 6 times in this code.


-- 


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-08-20 14:08 ` luisgpm at linux dot vnet dot ibm dot com
@ 2008-08-20 14:09 ` luisgpm at linux dot vnet dot ibm dot com
  2008-08-20 14:23 ` luisgpm at linux dot vnet dot ibm dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: luisgpm at linux dot vnet dot ibm dot com @ 2008-08-20 14:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from luisgpm at linux dot vnet dot ibm dot com  2008-08-20 14:07 -------
Created an attachment (id=16112)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16112&action=view)
Generated ASM code for the good case

The __ctype_toupper_loc function, differently than the bad case is called only
ONCE in this code.


-- 


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-08-20 14:09 ` luisgpm at linux dot vnet dot ibm dot com
@ 2008-08-20 14:23 ` luisgpm at linux dot vnet dot ibm dot com
  2008-08-20 14:51 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: luisgpm at linux dot vnet dot ibm dot com @ 2008-08-20 14:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from luisgpm at linux dot vnet dot ibm dot com  2008-08-20 14:21 -------
The preprocessed sources for strncasecmp.c are exactly the same for both cases.


-- 


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-08-20 14:23 ` luisgpm at linux dot vnet dot ibm dot com
@ 2008-08-20 14:51 ` jakub at gcc dot gnu dot org
  2008-08-20 15:53 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-08-20 14:51 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-08-20 02:25:37         |2008-08-20 14:49:55
               date|                            |


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-08-20 14:51 ` jakub at gcc dot gnu dot org
@ 2008-08-20 15:53 ` jakub at gcc dot gnu dot org
  2008-08-20 16:11 ` luisgpm at linux dot vnet dot ibm dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-08-20 15:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2008-08-20 15:51 -------
Subject: Bug 37171

Author: jakub
Date: Wed Aug 20 15:50:23 2008
New Revision: 139317

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139317
Log:
        PR c/37171
        * c-parser.c (c_parser_attributes): For keywords use canonical
        spelling for attr_name.

        * gcc.dg/pr37171.c: New test.
        * g++.dg/ext/attrib34.C: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr37171.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-parser.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2008-08-20 15:53 ` jakub at gcc dot gnu dot org
@ 2008-08-20 16:11 ` luisgpm at linux dot vnet dot ibm dot com
  2008-08-20 16:15 ` jakub at gcc dot gnu dot org
  2008-09-02 18:45 ` jakub at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: luisgpm at linux dot vnet dot ibm dot com @ 2008-08-20 16:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from luisgpm at linux dot vnet dot ibm dot com  2008-08-20 16:09 -------
With revision 139317, the numbers for 197.parser as back to normal and the
generated ASM code carries only a single call to __ctype_toupper_loc.


-- 


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2008-08-20 16:11 ` luisgpm at linux dot vnet dot ibm dot com
@ 2008-08-20 16:15 ` jakub at gcc dot gnu dot org
  2008-09-02 18:45 ` jakub at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-08-20 16:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jakub at gcc dot gnu dot org  2008-08-20 16:13 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug c/37171] [4.4 Regression] Canonical spelling optimization dependency
  2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2008-08-20 16:15 ` jakub at gcc dot gnu dot org
@ 2008-09-02 18:45 ` jakub at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-09-02 18:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jakub at gcc dot gnu dot org  2008-09-02 18:44 -------
Subject: Bug 37171

Author: jakub
Date: Tue Sep  2 18:42:48 2008
New Revision: 139904

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139904
Log:
        PR c/37171
        * g++.dg/ext/attrib34.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/attrib34.C
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2008-09-02 18:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-20  2:25 [Bug regression/37171] New: [4.4 Regression] Canonical spelling optimization dependency dje at gcc dot gnu dot org
2008-08-20  2:26 ` [Bug regression/37171] " dje at gcc dot gnu dot org
2008-08-20  9:42 ` [Bug c/37171] " rguenth at gcc dot gnu dot org
2008-08-20  9:42 ` [Bug regression/37171] " rguenth at gcc dot gnu dot org
2008-08-20 14:05 ` [Bug c/37171] " luisgpm at linux dot vnet dot ibm dot com
2008-08-20 14:06 ` luisgpm at linux dot vnet dot ibm dot com
2008-08-20 14:08 ` luisgpm at linux dot vnet dot ibm dot com
2008-08-20 14:09 ` luisgpm at linux dot vnet dot ibm dot com
2008-08-20 14:23 ` luisgpm at linux dot vnet dot ibm dot com
2008-08-20 14:51 ` jakub at gcc dot gnu dot org
2008-08-20 15:53 ` jakub at gcc dot gnu dot org
2008-08-20 16:11 ` luisgpm at linux dot vnet dot ibm dot com
2008-08-20 16:15 ` jakub at gcc dot gnu dot org
2008-09-02 18:45 ` jakub at gcc dot gnu dot 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).