Bug 522316 - GCC's backported var-tracking-assignments break LLVM 2.6 ppc build
Summary: GCC's backported var-tracking-assignments break LLVM 2.6 ppc build
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 12
Hardware: powerpc
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-10 03:51 UTC by Michel Lind
Modified: 2010-04-27 11:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-27 11:07:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
SPUISelDAGToDAG.ii.bz2 (221.71 KB, application/x-bzip2)
2009-09-10 09:33 UTC, Jakub Jelinek
no flags Details
Q2.C (4.73 KB, text/plain)
2009-09-11 15:52 UTC, Jakub Jelinek
no flags Details

Description Michel Lind 2009-09-10 03:51:20 UTC
Description of problem:
GCC 4.4.1-10 has the backported var-tracking-assignment from GCC 4.5; this breaks the PPC build of LLVM 2.6 (but works fine on i686 and x86_64)

Version-Release number of selected component (if applicable):
gcc-c++-4.4.1-10.ppc

How reproducible:
Always


Steps to Reproduce:
1. checkout Fedora's LLVM specs
2. disable workaround in 2.6-0.5.pre1
3. attempt a ppc build
  
Actual results:
Build fails: http://koji.fedoraproject.org/koji/buildinfo?buildID=131130

Expected results:
Build should pass, as it does in llvm-2.6-0.3.pre1 built with a previous GCC release

Additional info:

Comment 1 Jakub Jelinek 2009-09-10 09:33:14 UTC
Created attachment 360465 [details]
SPUISelDAGToDAG.ii.bz2

Reproduceable even on x86_64-linux -> powerpc64-linux cross.
./cc1plus -m32 -g -O2 SPUISelDAGToDAG.ii
eats lots of memory in vartrack pass, I've stopped it after it ate 31GB on my box.
I guess we really need to put some upper bounds on number of basic blocks/number of tracked VALUEs at which point we restart with ignoring DEBUG_INSNs.
Select_SPUISD_MUL64_MARKER_i64 has just 5 basic blocks though, so it is quite different from the few extreme PRs from cc1files VARIOUS.
There are hundreds of thousands of NOTE_VAR_INSN_LOCATION though.

The code is completely insane, calling a function with 1371 arguments, out of which 685 are classes passed by value mustn't be done by very smart programmers, that said var-tracking shouldn't require so much memory on it and just give up trying making the code debuggable.

Comment 2 Jakub Jelinek 2009-09-10 16:36:38 UTC
In *.compgotos the function in question has 3434 DEBUG_INSNs and 4349 other insns (just 4 calls and 3 jumps).

Comment 3 Michel Lind 2009-09-11 06:21:13 UTC
That Emit_201 bug just got filed by Chris Lattner upstream, so hopefully this will be addressed soon. I doubt it'd be for 2.6, though, it's not listed as a blocker.

http://llvm.org/bugs/show_bug.cgi?id=4946

Comment 4 Jakub Jelinek 2009-09-11 14:10:03 UTC
Self-contained testcase: ./cc1plus -g -O2 -m32:
struct A
{
  int a;
  A() : a(0) {}
  A(int x) : a(x) {}
};

struct B
{
  A a;
  void *b;
  B() : a(0), b(0) {}
  B(int x) : a(x), b(0) {}
  B(A x) : a(x), b(0) {}
};

#define X10 X1 X1 X1 X1 X1 X1 X1 X1 X1 X1
#define X100 X10 X10 X10 X10 X10 X10 X10 X10 X10 X10
#define X685 X100 X100 X100 X100 X100 X100 X10 X10 X10 X10 X10 X10 X10 X10 X1 X1 X1 X1 X1

extern void insane (
#define X1 B,
X685
#undef X1
int
);

int
not_sane ()
{
  insane (
#define X1 6,
X685
#undef X1
    7);
  return 0;
}

(strangely for -m64 it doesn't eat significant amount of memory).

Comment 5 Jakub Jelinek 2009-09-11 15:52:10 UTC
Created attachment 360697 [details]
Q2.C

Actually, it didn't reproduce this, it ate 700MB of RAM, but didn't start eating unbounded amounts of RAM quickly.
But this one reproduces it.

Comment 6 Alexandre Oliva 2009-09-12 06:47:59 UTC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41343 might be the same problem, and I posted over there a patch that alleviates the problem reported here.  It still takes a lot of memory and takes too long to compile, but memory consuption doesn't exactly explode, as garbage generated during expansion of location expressions is now recycled quickly.

Comment 7 Bug Zapper 2009-11-16 12:10:01 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Jakub Jelinek 2010-04-27 11:07:00 UTC
I believe this should be fixed now in recent gccs (like 4.4.3-18).


Note You need to log in before you can comment on or make changes to this bug.