aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
AgeCommit message (Collapse)AuthorFilesLines
2012-05-09compiler: Add -fgo-pkgpath option.Ian Lance Taylor17-320/+457
* lang.opt: Add -fgo-pkgpath. * go-lang.c (go_pkgpath): New static variable. (go_prefix): New static variable. (go_langhook_init): Pass go_pkgpath and go_prefix to go_create_gogo. (go_langhook_handle_option): Handle -fgo-pkgpath. Change -fgo-prefix handling to just set go_prefix. * go-c.h (go_set_prefix): Don't declare. (go_create_gogo): Add pkgpath and prefix to declaration. * go-gcc.cc (Gcc_backend::global_variable): Change unique_prefix to pkgpath. Don't include the package name in the asm name. * gccgo.texi (Invoking gccgo): Document -fgo-pkgpath. Update the docs for -fgo-prefix. From-SVN: r187356
2012-05-07compiler: fix an ICE when parsing 0xdie, reject token 0x123i.Ian Lance Taylor1-1/+3
The lexer used to incorrectly accept a token like 0x123i and interpreted it as 123i. It also used to die when encountering 0xdie. From-SVN: r187266
2012-05-07compiler: fix ICE in handling of rune constants.Ian Lance Taylor1-1/+4
This patch corrects an ICE in handling on constant expressions such as const r = ^'a' Part of issue 9. From-SVN: r187264
2012-05-07compiler: reject NOT operator on integer types.Ian Lance Taylor1-3/+6
The Go specification only accepts the NOT operator on boolean types. Fixes issue 10. From-SVN: r187262
2012-05-04compiler: Correct parse of for with possible composite literal.Ian Lance Taylor2-24/+48
Fixes, e.g., "for first := true; first; first = false {". From-SVN: r187176
2012-05-04compiler: Error if importing same package twice with same name.Ian Lance Taylor1-5/+0
From-SVN: r187142
2012-05-03compiler: Build import tables as needed for imported interfaces.Ian Lance Taylor1-0/+3
From-SVN: r187111
2012-05-03compiler: Fix order of initialization bug with global var a, b = f().Ian Lance Taylor4-18/+85
From-SVN: r187103
2012-04-30cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.cJan Hubicka2-1/+5
* cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c (cgraph_asm_nodes, cgraph_asm_last_node): Move to cgraphunit.c (cgraph_add_to_same_comdat_group): Remove. (cgraph_add_asm_node): Move to cgraphunit.c. (cgraph_make_decl_local): Move to symtab.c (cgraph_make_node_local_1): Update. (cgraph_can_remove_if_no_direct_calls_and): Update. (used_from_object_file_p): Update. (resolution_used_from_other_file_p): Move to symtab.c (cgraph_used_from_object_file_p): move to symtab.c (verify_cgraph_node): Verify same comdat groups. * cgraph.h (cgraph_asm_node): Rename to ... (asm_node): ... this one. (cgraph_asm_nodes): Rename to ... (asm_nodes): ... this one. (symtab_add_to_same_comdat_group): New function. (symtab_dissolve_same_comdat_group_list): New function. (symtab_used_from_object_file_p): Declare. (symtab_make_decl_local): Declare. (cgraph_add_to_same_comdat_group): Remove. (cgraph_add_asm_node): Remove. (cgraph_used_from_object_file_p, varpool_used_from_object_file_p): Remove. (cgraph_finalize_compilation_unit): Rename to ... (finalize_compilation_unit): ... this one. (cgraph_optimize): Rename to .... (compile): ... this one. (add_asm_node): Declare. (fixup_same_cpp_alias_visibility): Declare. (cgraph_make_decl_local): Remove. (varpool_assemble_pending_decls): Rename to ... (varpool_output_variables): ... this one. (varpool_remove_unreferenced_decls): Remove. * ipa-inline-transform.c (clone_inlined_nodes): Dissolve comdat groups. (preserve_function_body_p): Make static. * toplev.c (compile_file): Update comments; update. * cgraphunit.c: Update comments. (cgraph_expand_all_functions): Rename to ... (expand_all_functions): ... this one; update. (cgraph_mark_functions_to_output): Rename to ... (mark_functions_to_output): ... this one; cleanup. (cgraph_output_pending_asms): Remove prototype. (asm_nodes, asm_last_node): New static vars. (cgraph_process_new_functions): Update. (cgraph_reset_node): Cleanup; add comment. (cgraph_add_new_function): Update. (cgraph_output_pending_asms): Rename to ... (output_asm_statements): ... this one. (add_asm_node): New function. (fixup_same_cpp_alias_visibility): New function based on code in cgraph_analyze_function. (cgraph_analyze_function): Use it. (cgraph_order_sort): Update. (cgraph_output_in_order): Update. (cgraph_function_versioning): Update. (cgraph_optimize): Rename to ... (compile): ... this one; initialize streamer hooks here. (cgraph_finalize_compilation_unit): Rename to ... (finalize_compilation_unit): ... this one; do not initialize streamer hook here. * lto-streamer-out.c (lto_output_toplevel_asms): Update. * dwarf2out.c: Update ocmment. * optimize.c (maybe_clone_body): Use symtab_add_to_same_comdat_group. * method.c (use_thunk): Likewise. * semantics.c (maybe_add_lambda_conv_op): Likewise. * decl2.c (maybe_emit_vtables): Likewise. (cp_write_global_declarations): Use finalize_compilation_unit. * parser.c (cp_parser_asm_definition): Use add_asm_node. * lto-streamer-in.c (lto_input_toplevel_asms): Use add_asm_node * c-decl.c (c_write_global_declarations): Use finalize_compilation_unit. * langhooks.c (write_global_declarations): Update. * ipa.c (cgraph_externally_visible_p): Update. (dissolve_same_comdat_group_list): Remove. (function_and_variable_visibility): Update. * symtab.c: Inlcude lto-streamer.h and rtl.h (ld_plugin_symbol_resolution_names): New. (symtab_add_to_same_comdat_group): New. (symtab_dissolve_same_comdat_group_list): New. (resolution_used_from_other_file_p): Move here from cgraph.c (symtab_used_from_object_file_p): New. (symtab_make_decl_local): New. * passes.c (register_pass): Update comments. * c-parser.c (c_parser_asm_definition): Update. * varpool.c (varpool_analyze_node): Use fixup_same_cpp_alias_visibility. (varpool_remove_unreferenced_decls): Make static. (varpool_assemble_pending_decls): Rename to ... (varpool_output_variables): ... this one; call varpool_remove_unreferenced_decls. (varpool_used_from_object_file_p): Remove. * gogo-tree.cc (Gogo::write_globals): Use finalize_compilation_unit. * gcc-interface/utils.c (rest_of_subprog_body_compilation): Update comment. (gnat_write_global_declarations): Use finalize_compilation_unit. * f95-lang.c (gfc_finish): Update comments. * lto.c (lto_main): Use compile (). * lto-partition.c (partition_cgraph_node_p): Use symtab_used_from_object_file_p. (partition_varpool_node_p): Likewise. From-SVN: r186998
2012-04-28compiler: Fix some crashes on invalid code.Ian Lance Taylor2-2/+11
Fixes issue 7. From-SVN: r186929
2012-04-28compiler: Use less memory for array/slice literals.Ian Lance Taylor1-97/+177
Fixes issue 8 in gofrontend issues list. From-SVN: r186926
2012-04-24compiler: Fix order of evalation for m[0] = len(m) when m is a map.Ian Lance Taylor1-6/+12
From-SVN: r186772
2012-04-24compiler: Reject invalid composite literals.Ian Lance Taylor1-1/+10
From-SVN: r186766
2012-04-24compiler: Error for invalid use of ... in call.Ian Lance Taylor1-2/+22
From-SVN: r186739
2012-04-23go-lang.c (go_langhook_init): Set MPFR precision to 256.Ian Lance Taylor2-1/+5
* go-lang.c (go_langhook_init): Set MPFR precision to 256. time: Adjust float expression so that it first integer context. From-SVN: r186727
2012-04-23compiler: Correct handling of negative zero floating constant.Ian Lance Taylor1-1/+7
From-SVN: r186722
2012-04-20compiler: Don't call cgraph_mark_needed_node.Ian Lance Taylor1-1/+0
From-SVN: r186644
2012-04-20compiler, runtime: Add explicit checks for zero and overflow division.Ian Lance Taylor5-29/+153
* lang.opt: Add -fgo-check-divide-zero and -fgo-check-divide-overflow. * gccgo.texi (Invoking gccgo): Document new options. From-SVN: r186637
2012-04-18targhooks.c (default_case_values_threshold): Fix code style nit.Steven Bosscher2-1/+6
gcc/ * targhooks.c (default_case_values_threshold): Fix code style nit. * stmt.c (add_case_node, expand_case): Move logic to remove/reduce case range and type folding from here... * gimplify.c (gimplify_switch_expr): ... to here. Expect NULL_TREE type, as documented in tree.def fortran/ * trans-decl.c (gfc_trans_entry_master_switch): Build SWITCH_EXPR with NULL_TREE type instead of void_type_node. * trans-io.c (io_result): Likewise. * trans-stmt.c (gfc_trans_integer_select, gfc_trans_character_select): Likewise. go/ * go-gcc.cc (Gcc_backend::switch_statement): Build SWITCH_EXPR with NULL_TREE type instead of void_type_node. From-SVN: r186579
2012-04-16compiler: fix infinite recursion in string constant evaluation.Ian Lance Taylor1-2/+16
Fixes compilation of incorrect code: const f, g = g, f func S() []byte { return []byte(f) } The problem was already handled for numerical constants. Part of issue 3186 (go). From-SVN: r186511
2012-03-30compiler: Fix order of evaluation of struct composite literals.Ian Lance Taylor2-7/+47
From-SVN: r185990
2012-03-29compiler, libgo: unsafe.{Sizeof,Alignof,Offsetof} return uintptr.Ian Lance Taylor2-9/+13
From-SVN: r185946
2012-03-28compiler: fix null-dereference on invalid len() arg.Ian Lance Taylor1-2/+2
This patch fixes an ICE caused by syntax errors in arguments to unary built-in functions like len(). Updates issue 7. From Rémy Oudompheng. From-SVN: r185935
2012-03-28compiler: avoid an ICE on bound interface methods used as values.Ian Lance Taylor1-1/+2
Updates issue 7. From-SVN: r185933
2012-03-28compiler: fix method finalization of unnamed structs.Ian Lance Taylor1-1/+5
Used to trigger an ICE on var v struct{I}; type I interface{} Updates issue 7. From-SVN: r185931
2012-03-28compiler: fix crashes.Ian Lance Taylor2-1/+3
The compiler would crash on: if true || x, y := 1, 2 {} and var s string s = append(s, "hello") Reported in issue 3186. From-SVN: r185928
2012-03-28compiler: Rewrite handling of untyped numeric constants.Ian Lance Taylor5-2054/+1667
Fixes various bugs when, e.g., using float or complex constants in integer contexts. From-SVN: r185925
2012-03-09compiler: Be more careful to follow GENERIC type rules.Ian Lance Taylor3-6/+38
* go-gcc.cc (Gcc_backend::assignment_statement): Convert the rhs to the lhs type if necessary. From-SVN: r185128
2012-03-09compiler: Correct handling of sink receiver.Ian Lance Taylor1-3/+2
From-SVN: r185127
2012-03-08compiler: Don't initialize zero sized variables.Ian Lance Taylor5-5/+99
* go-gcc.cc (Gcc_backend::init_statement): Don't initialize a zero-sized variable. (go_non_zero_struct): New global variable. (Gcc_backend::non_zero_size_type): New function. (Gcc_backend::global_variable): Don't build an assignment for a zero-sized value. * go-c.h (go_non_zero_struct): Declare. * config-lang.in (gtfiles): Add go-c.h. From-SVN: r185115
2012-03-08compiler: Don't crash on array assignment.Ian Lance Taylor1-2/+4
From-SVN: r185092
2012-03-07compiler: Don't crash if writing type functions too late due to error.Ian Lance Taylor2-0/+11
From-SVN: r185080
2012-03-07compiler: Fix struct inheriting interface with varargs method.Ian Lance Taylor1-2/+6
From-SVN: r185060
2012-03-02libgo: Update to weekly.2012-02-14 release.Ian Lance Taylor1-54/+0
From-SVN: r184798
2012-03-01compiler: Reliably give errors on misuse of multiple value call.Ian Lance Taylor1-13/+16
From-SVN: r184755
2012-03-01compiler: Fix varargs functions that call recover.Ian Lance Taylor2-1/+8
Also fix a couple of crashes on invalid code. From-SVN: r184751
2012-03-01compiler: Fix handling of indirection of circular types.Ian Lance Taylor1-18/+22
From-SVN: r184686
2012-03-01compiler: Avoid some compiler crashes on invalid code.Ian Lance Taylor4-4/+15
* go-gcc.cc (class Gcc_tree): Add set_tree method. (set_placeholder_pointer_type): When setting to a pointer to error, set to error_mark_node. From-SVN: r184684
2012-03-01compiler: Fix unary ^ applied to typed signed integer constant.Ian Lance Taylor1-3/+22
From-SVN: r184681
2012-02-29compiler: Avoid various crashes on error conditions.Ian Lance Taylor2-14/+34
From-SVN: r184675
2012-02-29compiler: Fix handling of invalid types within invalid types.Ian Lance Taylor2-20/+7
From-SVN: r184674
2012-02-23go-gcc.cc (Gcc_backend::placeholder_pointer_type): Use build_distinct_type_copy.Richard Guenther2-1/+6
2012-02-23 Richard Guenther <rguenther@suse.de> * go-gcc.cc (Gcc_backend::placeholder_pointer_type): Use build_distinct_type_copy. From-SVN: r184507
2012-02-18compiler: Permit an empty interface to be embedded multiple times.Ian Lance Taylor1-1/+1
From-SVN: r184363
2012-02-17compiler: Permit (_) on left hand side of =.Ian Lance Taylor1-1/+1
From-SVN: r184356
2012-02-17compiler: List imported packages in export information.Ian Lance Taylor6-4/+74
From-SVN: r184355
2012-02-17compiler: Add parameter names to export information.Ian Lance Taylor9-46/+100
* Make-lang.in (go/import.o): Add dependency on $(GO_LEX_H). From-SVN: r184353
2012-02-17compiler: Don't lower binary expressions with mismatched types.Ian Lance Taylor1-0/+3
From-SVN: r184352
2012-02-17gospec.c (lang_specific_driver): If linking, and no -o option was used, add one.Ian Lance Taylor2-22/+41
* gospec.c (lang_specific_driver): If linking, and no -o option was used, add one. From-SVN: r184351
2012-02-17compiler: Fix backend representation for interface methods.Ian Lance Taylor1-2/+29
From-SVN: r184348
2012-02-17compiler: Check for initialization loop in constant initializer.Ian Lance Taylor1-2/+9
From-SVN: r184347