This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/58770] New: GCC very slow compiling with #pragma once
- From: "yellow at rg3 dot name" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 Oct 2013 17:11:47 +0000
- Subject: [Bug preprocessor/58770] New: GCC very slow compiling with #pragma once
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58770
Bug ID: 58770
Summary: GCC very slow compiling with #pragma once
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: yellow at rg3 dot name
Created attachment 31026
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31026&action=edit
Benchmark files
Putting #pragma once in a header file, with or without additional classic
include guards, makes GCC very slow.
I've created a small benchmark that I'm attaching, with the following files:
* common.h: a common file to be included 10,000 times, protected with guards or
the pragma. In the tarball there are three versions to be tested.
* header0000.h to header9999.h: header files that include common.h
* all.h: header file that includes all header????.h files.
* main.c: main program, includes common.h and all.h
Building that program with gcc -o main main.c takes 1.5 seconds with #pragma
once, while merely using include guards takes only 70 milliseconds.