First Last Prev Next    No search results available
Details
: Bugpoint doesn't support uses of external fns by immediat...
Bug#: 290
: tools
: bugpoint
Status: RESOLVED
Resolution: FIXED
: All
: All
: trunk
: P2
: enhancement
: ---

:
:
:
: 38
  Show dependency tree - Show dependency graph
People
Reporter: Brian R. Gaeke <gaeke+bugs@uiuc.edu>
Assigned To: Unassigned LLVM Bugs <unassignedbugs@nondot.org>
:

Attachments


Note

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

Related actions


Description:   Opened: 2004-03-12 12:58
I hit the "UNSUPPORTED: external function used as a global initializer!" abort
in bugpoint today, and I 
think a relatively simple enhancement to make would be to support things like
   %tmp.16 = call %struct.line* (...)* cast (%struct.line* ()* 
%next_active_node to %struct.line* (...)*)( )
You get things like this when you have K&R style function prototypes.

We could attack this by specifically checking for constant cast exprs that are
not wrapped in anything 
and only used in a single call instruction. But a more general solution would
be to check that the 
function's use is a constant expr such that
 1) the constant expr has only one use
 2) the constant expr's use is either
      a) an instruction, or
      b) a constant expr conforming to 1) & 2).
------- Comment #1 From Chris Lattner 2004-03-12 13:29:42 -------
This is definitely related to Bug 38.  If you run into this problem, you could
try running the instcombine pass, which cleans up cruft like this.  I'm not sure
if its really worth hacking around this "missing feature", instead we could just
fix it outright...

-Chris
------- Comment #2 From Brian R. Gaeke 2004-03-12 14:58:48 -------
Well, by way of explanation, I was running into this particular special case a
lot, and I thought it might 
be worth consideration because it's not *really* an external function being
used as a global initializer; 
in fact, it's not even a non-instruction using an external function. It's just
that bugpoint can't see 
through the cast.

First Last Prev Next    No search results available