Jakub Jelinek [Sat, 13 Dec 2014 11:24:37 +0000 (12:24 +0100)]
re PR bootstrap/64023 (r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler.)
PR bootstrap/64023
* Makefile.tpl (EXTRA_TARGET_FLAGS): Set STAGE1_LDFLAGS
to POSTSTAGE1_LDFLAGS and STAGE1_LIBS to POSTSTAGE1_LIBS.
Add -B to libstdc++-v3/src/.libs and libstdc++-v3/libsupc++/.libs
to CXX.
* Makefile.in: Regenerated.
Ian Lance Taylor [Sat, 13 Dec 2014 00:52:20 +0000 (00:52 +0000)]
runtime: Clear stack pointers for extra G's.
Fix an unusual C to Go callback case. Newly created C threads
call into Go code, forcing the Go code to allocate new M and G
structures. While executing Go code, the stack is split. The
Go code then returns. Returning from a Go callback is treated
as entering a system call, so the G gcstack field is set to
point to the Go stack. In this case, though, we were called
from a newly created C thread, so we drop the extra M and G
structures. The C thread then exits.
Then a new C thread calls into Go code, reusing the previously
created M and G. The Go code requires a larger stack frame,
causing the old stack segment to be unmapped and a new stack
segment allocated. At this point the gcstack field is
pointing to the old stack segment.
Then a garbage collection occurs. The garbage collector sees
that the gcstack field is not nil, so it scans it as the first
stack segment. Unfortunately it points to memory that was
unmapped. So the program crashes.
The fix is simple: when handling extra G structures created
for callbacks from new C threads, clear the gcstack field.
Jonathan Wakely [Fri, 12 Dec 2014 21:05:35 +0000 (21:05 +0000)]
re PR libstdc++/58594 (std::make_shared does not accept const types as parameters)
PR libstdc++/58594
* include/bits/shared_ptr_base.h: Cast away cv-quals.
* testsuite/20_util/shared_ptr/creation/58594-no-rtti.cc: New.
* testsuite/20_util/shared_ptr/creation/private.cc: Make allocator
rebindable so test passes with -fno-rtti.
Thomas Schwinge [Fri, 12 Dec 2014 20:14:10 +0000 (21:14 +0100)]
nvptx: Define valid ASM_OUTPUT_ALIGN.
gcc/
* config/nvptx/nvptx.h (ASM_OUTPUT_ALIGN): Define as a C statment.
gcc/doc/tm.texi:@defmac ASM_OUTPUT_ALIGN (@var{stream}, @var{power})
gcc/doc/tm.texi-A C statement to output to the stdio stream @var{stream} an assembler
gcc/doc/tm.texi-command to advance the location counter to a multiple of 2 to the
gcc/doc/tm.texi-@var{power} bytes. @var{power} will be a C expression of type @code{int}.
gcc/doc/tm.texi-@end defmac
[...]/source-gcc/gcc/dwarf2out.c: In function 'void output_fde(dw_fde_ref, bool, bool, char*, int, char*, bool, int)':
[...]/source-gcc/gcc/dwarf2out.c:665:3: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
^
[...]/source-gcc/gcc/varasm.c: In function 'void assemble_variable(tree, int, int, int)':
[...]/source-gcc/gcc/varasm.c:2217:2: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
^
[...]/source-gcc/gcc/varasm.c: In function 'rtx_def* assemble_trampoline_template()':
[...]/source-gcc/gcc/varasm.c:2603:5: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
ASM_OUTPUT_ALIGN (asm_out_file, align);
^
[...]/source-gcc/gcc/varasm.c: In function 'void output_constant_def_contents(rtx)':
[...]/source-gcc/gcc/varasm.c:3413:2: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
^
Also, "use" the values, to get rid of that one:
[...]/source-gcc/gcc/final.c: In function 'rtx_insn* final_scan_insn(rtx_insn*, FILE*, int, int, int*)':
[...]/source-gcc/gcc/final.c:2450:12: warning: variable 'log_align' set but not used [-Wunused-but-set-variable]
int log_align;
^
Jason Merrill [Fri, 12 Dec 2014 17:52:21 +0000 (12:52 -0500)]
cp-tree.h (NAMESPACE_ABI_TAG): New.
* cp-tree.h (NAMESPACE_ABI_TAG): New.
* name-lookup.c (handle_namespace_attrs): Set it.
* class.c (check_tag): Split out from find_abi_tags_r.
(find_abi_tags_r): Also check namespace tags.
(mark_type_abi_tags): Also mark namespace tags.
re PR middle-end/64182 (wide-int rounding division is broken)
gcc/
PR middle-end/64182
* wide-int.h (wi::div_round, wi::mod_round): Fix rounding of tied
cases.
* double-int.c (div_and_round_double): Fix handling of unsigned
cases. Use same rounding approach as wide-int.h.
gcc/testsuite/
2014-xx-xx Richard Sandiford <richard.sandiford@arm.com>
Joseph Myers <joseph@codesourcery.com>
PR middle-end/64182
* gcc.dg/plugin/wide-int-test-1.c,
gcc.dg/plugin/wide-int_plugin.c: New test.
* gcc.dg/plugin/plugin.exp: Register it.
* gnat.dg/round_div.adb: New test.
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
From-SVN: r218678
PR rtl-optimization/63917
* ifcvt.c (cc_in_cond): New function.
(end_ifcvt_sequence): Make sure new generated insns do not clobber CC.
(noce_process_if_block, check_cond_move_block): Check CC references.
Jan Hubicka [Thu, 11 Dec 2014 21:48:48 +0000 (22:48 +0100)]
re PR ipa/61324 (ICE: SIGSEGV at ipa-comdats.c:321 with -fno-use-cxa-atexit -fkeep-inline-functions)
PR ipa/61324
* testsuite/g++.dg/pr61324.C: New testcase by Trevor Saunders.
* testsuite/g++.dg/tm/pr51411-2.C: Update se the extern function is
not eliminated early.
* testsuite/gcc.target/i386/pr57756.c: Turn extern inline into static
inline.
* passes.c (execute_todo): Update call of remove_unreachable_nodes.
* ipa-chkp.c (chkp_produce_thunks): Use TODO_remove_functions.
* cgraphunit.c (symbol_table::process_new_functions): Add
IPA_SSA_AFTER_INLINING.
(ipa_passes): Update call of remove_unreachable_nodes.
(symbol_table::compile): Remove call of remove_unreachable_nodes.
* ipa-inline.c (inline_small_functions): Do not ICE with
-flto-partition=none
(ipa_inline): Update symtab->state; fix formatting
update call of remove_unreachable_nodes.
* cgraphclones.c (symbol_table::materialize_all_clones): Likewise.
* cgraph.h (enum symtab_state): Add IPA_SSA_AFTER_INLINING.
(remove_unreachable_nodes): Update.
* ipa.c (process_references): Keep external references only
when optimizing.
(walk_polymorphic_call_targets): Keep possible polymorphic call
target only when devirtualizing.
(symbol_table::remove_unreachable_nodes): Remove BEFORE_INLINING_P
parameter.
(ipa_single_use): Update comment.
* ipa-pure-const.c (cdtor_p): New function.
(propagate_pure_const): Track if some cdtor was turned pure/const.
(execute): Return TODO_remove_functions if needed.
* ipa-comdats.c (ipa_comdats): Update comment.
* lto.c (read_cgraph_and_symbols): Update call of
remove_unreachable_nodes.
(do_whole_program_analysis): Remove call of
symtab->remove_unreachable_nodes
Renlin Li [Thu, 11 Dec 2014 17:30:39 +0000 (17:30 +0000)]
[AArch64]Use AARCH64_FL_FPSIMD flags for all cores in aarch64-cores.def
gcc/
2014-12-11 Renlin Li <renlin.li@arm.com>
* config/aarch64/aarch64-cores.def: Change all AARCH64_FL_FPSIMD to
AARCH64_FL_FOR_ARCH8.
* config/aarch64/aarch64.c (all_cores): Use FLAGS from
aarch64-cores.def file only.
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/ChangeLog:
2014-12-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
* diagnostic.c (diagnostic_action_after_output): Make it extern.
Take diagnostic_t argument instead of diagnostic_info. Count also
DK_WERROR towards max_errors.
(diagnostic_report_diagnostic): Update call according to the above.
(error_recursion): Likewise.
* diagnostic.h (diagnostic_action_after_output): Declare.
* pretty-print.c (pp_formatted_text_data): Delete.
(pp_append_r): Call output_buffer_append_r.
(pp_formatted_text): Call output_buffer_formatted_text.
(pp_last_position_in_text): Call output_buffer_last_position_in_text.
* pretty-print.h (output_buffer_formatted_text): New.
(output_buffer_append_r): New.
(output_buffer_last_position_in_text): New.
gcc/fortran/ChangeLog:
2014-12-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
* error.c (pp_error_buffer): New static variable.
(pp_warning_buffer): Make it a pointer.
(gfc_output_buffer_empty_p): New.
(gfc_error_init_1): Call gfc_buffer_error.
(gfc_buffer_error): Do not use pp_warning_buffer.flush_p as the
buffered_p flag.
(gfc_clear_warning): Likewise.
(gfc_warning_check): Call gfc_clear_warning. Only check the new
pp_warning_buffer if the old warning_buffer was empty. Call
diagnostic_action_after_output.
(gfc_error_1): Renamed from gfc_error.
(gfc_error): New.
(gfc_clear_error): Clear also pp_error_buffer.
(gfc_error_flag_test): Check also pp_error_buffer.
(gfc_error_check): Likewise. Only check the new pp_error_buffer
if the old error_buffer was empty.
(gfc_move_output_buffer_from_to): New.
(gfc_push_error): Use it here. Take also an output_buffer as argument.
(gfc_pop_error): Likewise.
(gfc_free_error): Likewise.
(gfc_diagnostics_init): Use XNEW and placement-new to init
pp_error_buffer and pp_warning_buffer. Set flush_p to false for
both pp_warning_buffer and pp_error_buffer.
* Update gfc_push_error, gfc_pop_error and gfc_free_error calls
according to the above changes.
* Use gfc_error_1 for all gfc_error calls that use multiple
locations.
* Use %qs instead of '%s' for many gfc_error calls.
Andrew MacLeod [Thu, 11 Dec 2014 14:57:00 +0000 (14:57 +0000)]
gen-mul-tables.cc: Add insn-codes.h to include list for generator file.
2014-12-11 Andrew MacLeod <amacleod@redhat.com>
* config/tilepro/gen-mul-tables.cc: Add insn-codes.h to include list
for generator file. Add comment indicating it is a generated file.
* config/tilepro/mul-tables.c: Update generated file.
* config/tilegx/mul-tables.c: Likewise.
Tobias Burnus [Thu, 11 Dec 2014 08:20:24 +0000 (09:20 +0100)]
diagnostic.c (get_terminal_width): Renamed from
2014-12-11 Tobias Burnus <burnus@net-b.de>
Manuel López-Ibáñez <manu@gcc.gnu.org>
gcc/
* diagnostic.c (get_terminal_width): Renamed from
* getenv_columns,
removed static, and additionally use ioctl to get width.
(diagnostic_set_caret_max_width): Update call.
* diagnostic.h (get_terminal_width): Add prototype.
* opts.c (print_specific_help): Use it for x_help_columns.
* doc/invoke.texi (fdiagnostics-show-caret): Document how the
width is set.
gcc/fortran/
* error.c (gfc_get_terminal_width): Renamed from
get_terminal_width and use same-named common function.
(gfc_error_init_1): Update call.
Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>
From-SVN: r218619
Ulrich Drepper [Thu, 11 Dec 2014 04:31:52 +0000 (04:31 +0000)]
Minor interface cleanups of libgccjit
Minor interface cleanups of libgccjit
* jit/jit-playback.c (convert_to_dso): Use auto_vec instead
of automatic array to build up command line.
* jit/jit-recording.c (recording::context::set_str_option):
Make copy of the string.
(recording::context::~context): Free string options.
* jit/jit-recording.h (recording::context): Adjust type
of m_str_options member.
* jit/libgccjit.h: Adjust comment about
gcc_jit_context_set_str_option parameter begin used after
the call.
Update comment now that all interfaces are copy strings
if necessary.
* jit/libgccjit++.h (gccjit::context): Add set_str_option
member function.
Jan Hubicka [Wed, 10 Dec 2014 21:17:28 +0000 (22:17 +0100)]
invoke.texi: (-devirtualize-at-ltrans): Document.
* doc/invoke.texi: (-devirtualize-at-ltrans): Document.
* lto-cgraph.c (lto_output_varpool_node): Mark initializer as removed
when it is not streamed to the given ltrans.
(compute_ltrans_boundary): Make code adding all polymorphic
call targets conditional with !flag_wpa || flag_ltrans_devirtualize.
* common.opt (fdevirtualize-at-ltrans): New flag.
Ilya Verbin [Wed, 10 Dec 2014 20:52:10 +0000 (20:52 +0000)]
Force output of vars with "omp declare target" attribute in gcc/varpool.c
gcc/
* varpool.c (varpool_node::get_create): Force output of vars with
"omp declare target" attribute.
libgomp/
* testsuite/libgomp.c/target-9.c: New test.
David Malcolm [Wed, 10 Dec 2014 18:25:58 +0000 (18:25 +0000)]
Document libgccjit++.h
gcc/jit/ChangeLog:
* docs/cp/index.rst: New file.
* docs/cp/intro/index.rst: New file.
* docs/cp/intro/tutorial01.rst: New file.
* docs/cp/intro/tutorial02.rst: New file.
* docs/cp/intro/tutorial03.rst: New file.
* docs/cp/intro/tutorial04.rst: New file.
* docs/cp/topics/contexts.rst: New file.
* docs/cp/topics/expressions.rst: New file.
* docs/cp/topics/functions.rst: New file.
* docs/cp/topics/index.rst: New file.
* docs/cp/topics/locations.rst: New file.
* docs/cp/topics/objects.rst: New file.
* docs/cp/topics/results.rst: New file.
* docs/cp/topics/types.rst: New file.
* docs/examples/tut01-hello-world.cc: New file.
* docs/examples/tut02-square.c: Fix missing newline in output.
* docs/examples/tut02-square.cc: New file.
* docs/examples/tut03-sum-of-squares.cc: New file.
* docs/examples/tut04-toyvm/toyvm.cc: New file.
* docs/index.rst: Move summary to above the table of contents.
Add text about the C vs C++ APIs.
* docs/topics/contexts.rst: Fix a typo.
* docs/_build/texinfo/libgccjit.texi: Regenerate.
* docs/_build/texinfo/factorial1.png: New file.
* docs/_build/texinfo/sum-of-squares1.png: New file.
PR fortran/60718
* trans-expr.c (gfc_conv_procedure_call): Fix a strict aliasing
violation when passing a class object to a formal parameter which has
different pointer or allocatable attributes.
Martin Liska [Wed, 10 Dec 2014 14:07:47 +0000 (15:07 +0100)]
re PR ipa/63909 (ICE: SIGSEGV in ipa_icf_gimple::func_checker::compare_bb())
PR ipa/63909
* gimple-iterator.h (gsi_start_bb_nondebug): New function.
* ipa-icf-gimple.c (func_checker::compare_bb): Correct iteration
replaces loop based on precomputed number of non-debug statements.
* gcc.dg/ipa/pr63909.c: New test.