This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54054] New: merged compilation
- From: "wbrana at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 Jul 2012 16:29:00 +0000
- Subject: [Bug c++/54054] New: merged compilation
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54054
Bug #: 54054
Summary: merged compilation
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: wbrana@gmail.com
Using command
g++-4.7.1 -O3 -march=core2 -v -o test func.cpp main.cpp
GCC compiles files separately with
cc1plus func.cpp
cc1plus main.cpp
GCC could merge these files and compile only file merged.cpp
-------func.cpp---------
#include "func.h"
#include <stdlib.h>
long int func() {
return random();
}
-------main.cpp--------
#include "func.h"
#include <stdlib.h>
int main() {
return func();
}
-----merged.cpp-------
#include "func.h"
#include <stdlib.h>
long int func() {
return random();
}
int main() {
return func();
}