This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Disappearing labels fix


  In message <01043015572800.21472@enzo.bigblue.local>you write:
  > Just a followup, with Java disabled I get the following regressions with 
  > -fPIC:
  > 
  > FAIL: gcc.c-torture/compile/20001221-1.c,  -O2
  > FAIL: gcc.c-torture/compile/20001221-1.c,  -O3 -fomit-frame-pointer
  > FAIL: gcc.c-torture/compile/20001221-1.c,  -O3 -g
  > FAIL: gcc.c-torture/compile/20001221-1.c,  -Os
  > FAIL: gcc.c-torture/execute/20010106-1.c compilation,  -O3 
  > -fomit-frame-pointer
  > FAIL: gcc.c-torture/execute/20010106-1.c compilation,  -O3 -g
  > FAIL: gcc.c-torture/execute/980707-1.c compilation,  -O1
  > FAIL: gcc.c-torture/execute/980707-1.c compilation,  -O2
  > FAIL: gcc.c-torture/execute/980707-1.c compilation,  -O3 -fomit-frame-point
  > er
  > FAIL: gcc.c-torture/execute/980707-1.c compilation,  -O3 -fomit-frame-point
  > er 
  > -funroll-loops
  > FAIL: gcc.c-torture/execute/980707-1.c compilation,  -O3 -fomit-frame-point
  > er 
  > -funroll-all-loops -finline-functions
  > FAIL: gcc.c-torture/execute/980707-1.c compilation,  -O3 -g
  > FAIL: gcc.dg/switch-1.c (test for excess errors)                           
Thanks.  From looking at things, I suspect that this stuff would probably
fail with gcc-2.95.x in a similar manner.

Today is one of those days I really hate GCC.  The braindamaged way we handle
jump tables makes this an interesting problem.

Basically CSE turns the tablejump into a direct jump, but leaves the actual
jump table alone (as it should IMHO).

Because we're setting LABEL_PRESERVE_P, the jump optimizer isn't able to
delete the CODE_LABEL which proceeds the jump table, and ultimately it never
gets deleted leading to the undefined labels.

In an ideal world, the jump table would be attached to the table jump insn
itself.  That would allow us to easily remove the tablejump either inside
CSE or later during jump optimizations (it would also allow us to clean up
several gross hacks in flow.c and jump.c).

Unfortunately, today's world is less than ideal.  So I wrote a little routine
which runs during jump optimizations to find any jump tables which aren't
referenced by a table jump insn and removes them.  It's clean and simple.
I'm testing that patch overnight.  More info tomorrow after it finishes.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]