When I compile the application "zhcon" with a recent version of gcc 4.2, cc1plus just sits there eating CPU and RAM but doesn't actually seem to do anything. gcc 4.1 or older versions of gcc 4.2 compile the program in a few seconds. I tried to reduce this to a small testcase and it's included below. Unfortunately, I cannot tell what gcc is exactly doing but based on the testcase someone should be able to figure it out. (Please update the Summary of this bug with a better description once you know.)
20060626: works 20060714: fails 20060721: fails I cannot test a newer gcc snapshot right now. cc1plus just sits there: /usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.2.0/cc1plus -O2 test.cpp int main() Analyzing compilation unitPerforming intraprocedural optimizations Assembling functions: int main() The test case is below. You need to compile with -O2 -- lower levels work. #include <asm/types.h> #define fb_readl(addr) (*(volatile __u32 *) (addr)) #define fb_writel(b,addr) (*(volatile __u32 *) (addr) = (b)) int main() { __u8* dest; __u32* dest32; dest32 = (__u32*)dest; for (int cnt = 10; cnt--;) { fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32++); } } -- Summary: [4.2 regression] cc1plus just sits there eating CPU and RAM for a simple program Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tbm at cyrius dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28479