First Last Prev Next    No search results available
Details
: [llvm-gcc] Inline function redefinitions error due to 'as...
Bug#: 397
: tools
: llvm-gcc
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.0
: P2
: normal
: 1.4

:
: compile-fail
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments
Preprocessed source that triggers the error. (131.69 KB, text/plain)
2004-07-03 01:06, Markus F.X.J. Oberhumer
Details
Reduced testcase (1.06 KB, text/plain)
2004-07-03 10:59, Chris Lattner
Details
More reduced testcase. (693 bytes, text/plain)
2004-10-26 12:11, Markus F.X.J. Oberhumer
Details
Testcase with warning instead of ICE. (355 bytes, text/plain)
2004-10-26 12:19, Markus F.X.J. Oberhumer
Details


Note

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

Related actions


Description:   Opened: 2004-07-03 01:04
This happens on linux/i386:

cc1plus: ../../gcc/llvm-representation.c:237: llvm_value_print_operand:
Assertion `!Fn->ForwardedFunction->ForwardedFunction&&"Cannot double forward!"'
failed.
llvm_bug.cpp:3789: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://llvm.cs.uiuc.edu> for instructions.
------- Comment #1 From Markus F.X.J. Oberhumer 2004-07-03 01:06:42 -------
Created an attachment (id=148) [details]
Preprocessed source that triggers the error.
------- Comment #2 From Chris Lattner 2004-07-03 10:59:20 -------
Created an attachment (id=149) [details]
Reduced testcase

Here's a mostly reduced testcase
------- Comment #3 From Chris Lattner 2004-07-06 23:26:41 -------
btw, I'm not going to be able to get to this tonight.  Probably in the next few
days it will be fixed.  Sorry abt that!
------- Comment #4 From Martin 2004-07-25 11:40:47 -------
Hello, I currently encounter the same problem as Markus. It too seems to stem
from the inclusion of file I/O related files. I would greatly appreciate seeing
this problem resolved. If you need my test case too, please let me know. Thank
you very much.
------- Comment #5 From Markus F.X.J. Oberhumer 2004-10-19 22:09:15 -------
Might I ask somebody to look at this bug once again? 

It is currently a showstopper for using C++ on linux/i386 for lots of programs,
as the ICE is triggered by just including <sys/stat.h>.

Thanks.
------- Comment #6 From Reid Spencer 2004-10-19 23:45:06 -------
I looked at this problem. It is easily reproducible using the reduced testcase.
I believe the problem is the use of __asm__(...) in the declarations of the
various "stat" functions.   At least, when I delete them, it compiles fine.
Since llvm-gcc doesn't support inline assembly, the necessary fix is to hack the
stat.h header file. The original bug report says this comes from linux/i386. 
Looking at /usr/include/sys/stat.h on my machine, one potential workaround is to
undefine __REDIRECT before include sys/stat.h This is the macro that uses the
asm statement to redirect to another function name. If it is not defined then
the redirect is done by the pre-processor with a #define.

Worth a try anyway.
------- Comment #7 From Markus F.X.J. Oberhumer 2004-10-20 01:04:29 -------
Please note that the use of __asm__ in this context does not refer to (inline)
assembly, but rather it defines the external (linkage) name of a function/symbol. 

------- Comment #8 From Brian R. Gaeke 2004-10-20 12:55:18 -------
Just as an update, the reduced test case still triggers the assertion
using today's CVS HEAD llvm-g++.
------- Comment #9 From Reid Spencer 2004-10-20 12:58:57 -------
Yes. The changes I made to llvm-expand.c are unrelated and just remove some
compilation warnings that bothered me. I'm not really sure how to fix this
double indirection thing (function defined as asm defined as asm) except using
the workaround I previous posted (undefine __REDIRECT macro)
------- Comment #10 From Chris Lattner 2004-10-21 09:32:12 -------
Hi all,

I'm currently out of town, but I will try to get this one when I get back. 
Unfortunately, I don't know if this bug is ours, or if it is in the gcc bits
that we imported.  I will find out for sure though when I can.

-Chris

btw, unassignedbugs goes to me, so there is no need to have me on the cc list. 
Thanks!
------- Comment #11 From Markus F.X.J. Oberhumer 2004-10-26 12:11:37 -------
Created an attachment (id=180) [details]
More reduced testcase.

I've further reduced the testcase and did more testing:
- it works if you compile it as C source
- it works in C++ if you remove the extern "C"
- it works in C++ if you #define __inline__ to nothing

Also, if you start changing the lstat parameters to someting like int
lstat(int) the ICE goes aways and you get a "warning: LLVM: LinkOnce function
redefined to external!".

Markus
------- Comment #12 From Markus F.X.J. Oberhumer 2004-10-26 12:19:45 -------
Created an attachment (id=181) [details]
Testcase with warning instead of ICE.

For completness, here is the modified testcase that generates "warning: LLVM:
LinkOnce function redefined to external!".

First Last Prev Next    No search results available