Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvm-gcc4 doesn't support GCC address of label extension #1319

Closed
nlewycky opened this issue Oct 16, 2006 · 6 comments
Closed

llvm-gcc4 doesn't support GCC address of label extension #1319

nlewycky opened this issue Oct 16, 2006 · 6 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla enhancement Improving things as opposed to bug fixing, e.g. new or missing feature llvm-tools All llvm tools that do not have corresponding tag

Comments

@nlewycky
Copy link
Contributor

Bugzilla Link 947
Resolution FIXED
Resolved on Feb 22, 2010 12:44
Version 1.7
OS All
Blocks #870 llvm/llvm-bugzilla-archive#1166

Extended Description

Taking the address of a label doesn't seem to be supported in llvm-gcc4. This
GCC extension is described in
http://gcc.gnu.org/onlinedocs/gcc-4.0.2/gcc/Labels-as-Values.html . This is the
program:

void foo() {
void *ptr;
label:
ptr = &&label;
}

$ llvm-gcc gotolabel.c
Unhandled lvalue expression!
<label_decl 0x55a6fd98 label
type <void_type 0x55a26708 void sizes-gimplified VOID
align 8 symtab 145740416 alias set -1
pointer_to_this <pointer_type 0x55a26780>>
side-effects used asm-frame-size 0 VOID file gotolabel.c line 4
align 1 context <function_decl 0x55a6fb40 foo> initial <error_mark 0x55a172d8>
LLVM: label %label>
gotolabel.c: In function ‘foo’:
gotolabel.c:1: internal compiler error: in EmitLV, at llvm-convert.cpp:604
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://llvm.org/bugs for instructions.

Here's a backtrace:

#​0 internal_error (gmsgid=0x890e091 "in %s, at %s:%d")
at ../../src/gcc/diagnostic.c:532
#​1 0x08166d7f in fancy_abort (
file=0x8953e40 "../../src/gcc/llvm-convert.cpp", line=604,
function=0x895eec9 "EmitLV") at ../../src/gcc/diagnostic.c:588
#​2 0x0832269b in TreeToLLVM::EmitLV (this=0xffffaee4, exp=0x55a6fd98)
at ../../src/gcc/llvm-convert.cpp:604
#​3 0x083242aa in TreeToLLVM::EmitADDR_EXPR (this=0xffffaee4, exp=0x55a1c230)
at ../../src/gcc/llvm-convert.cpp:1718
#​4 0x0832223d in TreeToLLVM::Emit (this=0xffffaee4, exp=0x55a1c230,
DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:513
#​5 0x0833c94b in TreeToLLVM::EmitMODIFY_EXPR (this=0xffffaee4,
exp=0x55a1c258, DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:2055
#​6 0x0832210d in TreeToLLVM::Emit (this=0xffffaee4, exp=0x55a1c258,
DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:515
#​7 0x0833add3 in TreeToLLVM::EmitSTATEMENT_LIST (this=0xffffaee4,
exp=0x55a77690, DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:1168
#​8 0x08322163 in TreeToLLVM::Emit (this=0xffffaee4, exp=0x55a77690,
DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:488
#​9 0x0833b948 in TreeToLLVM::EmitBIND_EXPR (this=0xffffaee4, exp=0x55a71068,
DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:1143
#​10 0x083220e0 in TreeToLLVM::Emit (this=0xffffaee4, exp=0x55a71068,
DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:487
#​11 0x0830e0d3 in llvm_emit_code_for_current_function (fndecl=0x55a6fb40)
at ../../src/gcc/llvm-backend.cpp:412
#​12 0x080dc8bf in tree_rest_of_compilation (fndecl=0x55a6fb40)
at ../../src/gcc/tree-optimize.c:704
#​13 0x0805e3a3 in c_expand_body (fndecl=0x55a6fb40)
at ../../src/gcc/c-decl.c:6954
#​14 0x083819ad in cgraph_expand_function (node=0x55a6fe10)
at ../../src/gcc/cgraphunit.c:896
#​15 0x08381b65 in cgraph_assemble_pending_functions ()
at ../../src/gcc/cgraphunit.c:313
#​16 0x08384165 in cgraph_finalize_function (decl=0x55a6fb40, nested=false)
at ../../src/gcc/cgraphunit.c:411
#​17 0x0805e965 in finish_function () at ../../src/gcc/c-decl.c:6923
#​18 0x08054808 in yyparse () at c-parse.y:440
#​19 0x080557eb in c_parse_file () at c-parse.y:3483
#​20 0x080a5c7a in c_common_parse_file (set_yydebug=0)
at ../../src/gcc/c-opts.c:1238
#​21 0x082e145a in toplev_main (argc=2, argv=0xffffbb34)
at ../../src/gcc/toplev.c:1100
#​22 0x080bb632 in main (argc=1634296879, argv=0x736f6e67)
at ../../src/gcc/llvm-main.cpp:37

@nlewycky
Copy link
Contributor Author

assigned to @lattner

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 3, 2006

Is this something we're going to fix for 1.9 release? Its an extension and
implies new functionality.

@lattner
Copy link
Collaborator

lattner commented Nov 3, 2006

not for 1.9

@asl
Copy link
Collaborator

asl commented Feb 4, 2007

@asl
Copy link
Collaborator

asl commented Feb 4, 2007

@lattner
Copy link
Collaborator

lattner commented Feb 8, 2007

Implemented. Patches here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070205/044158.html

Testcase here: test/CFrontend/2007-02-07-AddrLabel.c

I verified that the other cases attached to this PR work as well.

-Chris

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
clementval added a commit to clementval/llvm-project that referenced this issue Dec 9, 2021
@Endilll Endilll added enhancement Improving things as opposed to bug fixing, e.g. new or missing feature and removed missing-feature labels Aug 15, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla enhancement Improving things as opposed to bug fixing, e.g. new or missing feature llvm-tools All llvm tools that do not have corresponding tag
Projects
None yet
Development

No branches or pull requests

5 participants