Jason Merrill [Mon, 10 Mar 2014 15:44:50 +0000 (11:44 -0400)]
re PR c++/53492 (ICE in retrieve_specialization, at cp/pt.c:985)
PR c++/53492
* parser.c (cp_parser_class_head): Also check PRIMARY_TEMPLATE_P
when deciding whether to call push_template_decl for a member class.
* pt.c (push_template_decl_real): Return after wrong levels error.
Jerry DeLisle [Sun, 9 Mar 2014 05:34:34 +0000 (05:34 +0000)]
re PR libfortran/38199 (missed optimization: I/O performance)
2014-03-08 Jerry DeLisle <jvdelisle@gcc.gnu>
PR libfortran/38199
* io/list_read.c (next_char): Mark unlikely error checks.
(eat_spaces): For character array reading, skip ahead over
spaces rather than call next_char multiple times.
Jerry DeLisle [Sun, 9 Mar 2014 03:17:16 +0000 (03:17 +0000)]
re PR libfortran/38199 (missed optimization: I/O performance)
2014-03-08 Jerry DeLisle <jvdelisle@gcc.gnu>
PR libfortran/38199
* io/list_read.c (next_char): Delete unuseful error checks.
(eat_spaces): For character array reading, skip ahead over
spaces rather than call next_char multiple times.
Tobias Burnus [Sat, 8 Mar 2014 11:06:48 +0000 (12:06 +0100)]
gfortran.texi (Fortran 2003 Status): Mention finalization, deferred-length character support and input rounding.
2014-03-08 Tobias Burnus <burnus@net-b.de>
* gfortran.texi (Fortran 2003 Status): Mention finalization,
deferred-length character support and input rounding.
(Fortran 2008 Status): Mention that at termination
signalling exceptions are shown.
Paulo Matos [Sat, 8 Mar 2014 10:54:05 +0000 (11:54 +0100)]
lto-wrapper.c (merge_and_complain): Ensure -fshort-double is used consistently accross all TUs.
2014-03-08 Paulo Matos <paulo@matos-sorge.com>
Richard Biener <rguenther@suse.de>
* lto-wrapper.c (merge_and_complain): Ensure -fshort-double is used
consistently accross all TUs.
(run_gcc): Enable -fshort-double automatically at link at link-time
and disallow override.
2014-03-08 Paulo Matos <paulo@matos-sorge.com>
* c.opt: Enable LTO FE for fshort-double.
2014-03-08 Paulo Matos <paulo@matos-sorge.com>
* gcc.dg/lto/pr55113_0.c: New testcase.
2014-03-08 Paulo Matos <paulo@matos-sorge.com>
* lto-lang.c (lto_init): Pass flag_short_double to
build_common_tree_nodes.
Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r208428
Adam Butcher [Sat, 8 Mar 2014 09:33:12 +0000 (09:33 +0000)]
re PR c++/60033 ([c++1y] ICE in retrieve_specialization while compiling recursive generic lambda)
Fix PR c++/60033
PR c++/60033
* pt.c (tsubst_copy): When retrieving a capture pack from a generic
lambda, remove the lambda's own template argument list prior to fetching
the specialization.
PR c++/60033
* g++.dg/cpp1y/pr60033.C: New testcase.
Adam Butcher [Sat, 8 Mar 2014 09:33:03 +0000 (09:33 +0000)]
re PR c++/60393 ([c++1y] ICE with with invalid functions with auto parameters)
Fix PR c++/60393
PR c++/60393
* parser.c (cp_parser_parameter_declaration_clause): Move generic
function template unwinding on error into a more general location, ...
(cp_parser_skip_to_end_of_statement): ... here.
PR c++/60393
* g++.dg/cpp1y/pr60393.C: New testcase.
re PR target/58271 (ICE in gcc for a MIPS target during compilation with -mpaired-single -ftree-vectorize)
gcc/
PR target/58271
* config/mips/mips.c (mips_option_override): Promote -mpaired-single
warning to an error. Disable TARGET_PAIRED_SINGLE and TARGET_MIPS3D
if they can't be used.
PR libgfortran/60128
* io/write_float.def (output_float): Remove unused variable
nzero_real. Replace a double space with a single one.
(determine_en_precision): Fix wrong handling of the EN format.
PR libfortran/60128
* gfortran.dg/fmt_en.f90: New test.
Doug Rupp [Fri, 7 Mar 2014 20:35:33 +0000 (20:35 +0000)]
re PR ada/60411 (Ada bootstrap failure on ARM)
2014-03-07 Doug Rupp <rupp@adacore.com>
PR ada/60411
* system-linux-armel.ads (Backend_Overflow_Checks): Set to True.
(Support_64_Bit_Divides): Removed, no longer used.
(ZCX_By_Default): Enabled.
Jason Merrill [Fri, 7 Mar 2014 20:01:12 +0000 (15:01 -0500)]
g++-dg.exp (g++-dg-runtest): Run tests in C++1y mode, too.
* lib/g++-dg.exp (g++-dg-runtest): Run tests in C++1y mode, too.
* lib/target-supports.exp (check_effective_target_c++11): Now
means C++11 and up.
(check_effective_target_c++11_only): New.
(check_effective_target_c++11_down): New.
(check_effective_target_c++1y): New.
(check_effective_target_c++1y_only): New.
(check_effective_target_c++98_only): Rename from
check_effective_target_c++98.
* g++.dg/*: Use { target c++11 } instead of -std=c++11.
Jakub Jelinek [Fri, 7 Mar 2014 12:58:27 +0000 (13:58 +0100)]
re PR bootstrap/58572 (make bootstrap-lean leads to installation failure (doing extra rebuilds and invoking system compiler))
PR bootstrap/58572
* Makefile.tpl (POSTSTAGE1_CXX_EXPORT): Use -isystem instead of
-I for libstdc++-v3 includes if $(LEAN).
* Makefile.in: Regenerated.
Rainer Orth [Fri, 7 Mar 2014 11:30:40 +0000 (11:30 +0000)]
Disable local dynamic TLS model on Solaris/x86 if as/ld cannot handle it
* configure.ac (TLS_SECTION_ASM_FLAG): Save as tls_section_flag.
(LIB_TLS_SPEC): Save as ld_tls_libs.
(HAVE_AS_IX86_TLSLDMPLT): Define as 1/0.
(HAVE_AS_IX86_TLSLDM): New test.
* configure, config.in: Regenerate.
* config/i386/i386.c (legitimize_tls_address): Fall back to
TLS_MODEL_GLOBAL_DYNAMIC on 32-bit Solaris/x86 if tool chain
cannot support TLS_MODEL_LOCAL_DYNAMIC.
* config/i386/i386.md (*tls_local_dynamic_base_32_gnu): Use if
instead of #ifdef in HAVE_AS_IX86_TLSLDMPLT test.
runtime: Fix GC bug caused by Entersyscall modifying reg.
This patch fixes a rare but serious bug. The Go garbage
collector only examines Go stacks. When Go code calls a
function that is not written in Go, it first calls
syscall.Entersyscall. Entersyscall records the position of
the Go stack pointer and saves a copy of all the registers.
If the garbage collector runs while the thread is executing
the non-Go code, the garbage collector fetches the stack
pointer and registers from the saved location.
Entersyscall saves the registers using the getcontext
function. Unfortunately I didn't consider the possibility
that Entersyscall might itself change a register before
calling getcontext. This only matters for callee-saved
registers, as caller-saved registers would be visible on the
saved stack. And it only matters if Entersyscall is compiled
to save and modify a callee-saved register before it calls
getcontext. And it only matters if a garbage collection
occurs while the non-Go code is executing. And it only
matters if the only copy of a valid Go pointer happens to be
in the callee-saved register when Entersyscall is called.
When all those conditions are true, the Go pointer might get
collected incorrectly, leading to memory corruption.
This patch tries to avoid the problem by splitting
Entersyscall into two functions. The first is a simple
function that just calls getcontext and then calls the rest of
Entersyscall. This should fix the problem, provided the
simple Entersyscall function does not itself modify any
callee-saved registers before calling getcontext. That seems
to be true on the systems I checked. But since the argument
to getcontext is an offset from a TLS variable, it won't be
true on a system which needs to save callee-saved registers in
order to get the address of a TLS variable. I don't know why
any system would work that way, but I don't know how to rule
it out. I think that on any such system this will have to be
implemented in assembler. I can't put the ucontext_t
structure on the stack, because this function can not split
stacks, and the ucontext_t structure is large enough that it
could cause a stack overflow.
Paul Thomas [Thu, 6 Mar 2014 21:45:31 +0000 (21:45 +0000)]
re PR fortran/51976 ([F2003] Support deferred-length character components of derived types (allocatable string length))
2014-03-06 Paul Thomas <pault@gcc.gnu.org>
Janus Weil <janus@gcc.gnu.org>
PR fortran/51976
* gfortran.h (symbol_attribute): Add deferred_parameter attribute.
* primary.c (build_actual_constructor): It is not an error if
a missing component has the deferred_parameter attribute;
equally, if one is given a value, it is an error.
* resolve.c (resolve_fl_derived0): Remove error for deferred
character length components. Add the hidden string length
field to the structure. Give it the deferred_parameter
attribute.
* trans-array.c (duplicate_allocatable): Add a strlen field
which is used as the element size if it is non-null.
(gfc_duplicate_allocatable, gfc_copy_allocatable_data): Pass a
NULL to the new argument in duplicate_allocatable.
(structure_alloc_comps): Set the hidden string length as
appropriate. Use it in calls to duplicate_allocatable.
(gfc_alloc_allocatable_for_assignment): When a deferred length
backend declaration is variable, use that; otherwise use the
string length from the expression evaluation.
* trans-expr.c (gfc_conv_component_ref): If this is a deferred
character length component, the string length should have the
value of the hidden string length field.
(gfc_trans_subcomponent_assign): Set the hidden string length
field for deferred character length components. Allocate the
necessary memory for the string.
(alloc_scalar_allocatable_for_assignment): Same change as in
gfc_alloc_allocatable_for_assignment above.
* trans-stmt.c (gfc_trans_allocate): Likewise.
* trans-intrinsic (size_of_string_in_bytes): Make non-static.
* trans-types.c (gfc_get_derived_type): Set the tree type for
a deferred character length component.
* trans.c (gfc_deferred_strlen): New function.
* trans.h (size_of_string_in_bytes,gfc_deferred_strlen): New prototypes.
2014-03-06 Paul Thomas <pault@gcc.gnu.org>
Janus Weil <janus@gcc.gnu.org>
PR fortran/51976
* gfortran.dg/deferred_type_component_1.f90 : New test.
* gfortran.dg/deferred_type_component_2.f90 : New test.
Co-Authored-By: Janus Weil <janus@gcc.gnu.org>
From-SVN: r208386
Marek Polacek [Thu, 6 Mar 2014 13:41:46 +0000 (13:41 +0000)]
re PR c/60197 (ICE with _Cilk_spawn in expression)
PR c/60197
c-family/
* cilk.c (contains_cilk_spawn_stmt): New function.
(contains_cilk_spawn_stmt_walker): Likewise.
(recognize_spawn): Give error on invalid use of _Cilk_spawn.
* c-common.h (contains_cilk_spawn_stmt): Add declaration.
c/
* c-typeck.c (c_finish_return): Call contains_cilk_spawn_stmt instead
of checking tree code.
cp/
* typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead
of checking tree code.
testsuite/
* c-c++-common/cilk-plus/CK/pr60197.c: New test.
* c-c++-common/cilk-plus/CK/pr60197-2.c: New test.
* tree-streamer.c (record_common_node): Assert we don't record
nodes with type double.
(preload_common_node): Skip type double, complex double and
double pointer since it is now frontend dependent due to
fshort-double option.
Richard Biener [Thu, 6 Mar 2014 08:48:01 +0000 (08:48 +0000)]
gcc.c (PLUGIN_COND): Always enable unless -fno-use-linker-plugin or -fno-lto is specified and the...
2014-03-06 Richard Biener <rguenther@suse.de>
* gcc.c (PLUGIN_COND): Always enable unless -fno-use-linker-plugin
or -fno-lto is specified and the linker has full plugin support.
* collect2.c (lto_mode): Default to LTO_MODE_WHOPR if LTO is
enabled.
(main): Remove -flto processing, adjust lto_mode using
use_plugin late.
* lto-wrapper.c (merge_and_complain): Merge compile-time
optimization levels.
(run_gcc): And pass it through to the link options.
Jakub Jelinek [Wed, 5 Mar 2014 20:07:50 +0000 (21:07 +0100)]
re PR testsuite/59308 (gcc.dg/tree-ssa/ssa-ifcombine-ccmp-[1456] tests fail on arm cortex-a5)
PR testsuite/59308
* gcc.dg/pr46309.c: Don't compile on logical_op_short_circuit targets
other than mips/avr. Use -mbranch-cost=2 even for i?86/x86_64.
* gcc.dg/tree-ssa/reassoc-32.c: Use -mbranch-cost=2 even for
s390*/i?86/x86_64.
* gcc.dg/tree-ssa/reassoc-33.c: Likewise.
* gcc.dg/tree-ssa/reassoc-34.c: Likewise.
* gcc.dg/tree-ssa/reassoc-35.c: Likewise.
* gcc.dg/tree-ssa/reassoc-36.c: Likewise.
* gcc.dg/tree-ssa/ssa-ifcombine-ccmp-1.c: Don't compile on
logical_op_short_circuit targets other than avr. Use -mbranch-cost=2
even for mips*/s390*/i?86/x86_64.
* gcc.dg/tree-ssa/ssa-ifcombine-ccmp-2.c: Likewise.
* gcc.dg/tree-ssa/ssa-ifcombine-ccmp-3.c: Likewise.
* gcc.dg/tree-ssa/ssa-ifcombine-ccmp-4.c: Likewise.
* gcc.dg/tree-ssa/ssa-ifcombine-ccmp-5.c: Likewise.
* gcc.dg/tree-ssa/ssa-ifcombine-ccmp-6.c: Likewise.
Jason Merrill [Wed, 5 Mar 2014 17:53:28 +0000 (12:53 -0500)]
re PR c++/60361 (unexpected 'use of parameter outside function body' error)
PR c++/60361
* parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
if re-parsing might succeed.
* semantics.c (finish_id_expression): Use of a parameter outside
the function body is a parse error.
Jakub Jelinek [Wed, 5 Mar 2014 08:46:31 +0000 (09:46 +0100)]
re PR lto/60404 (wrong code by LTO on x86_64-linux-gnu)
PR lto/60404
* cfgexpand.c (expand_used_vars): Do not assume all SSA_NAMEs
of PARM/RESULT_DECLs must be coalesced with optimize && in_lto_p.
* tree-ssa-coalesce.c (coalesce_ssa_name): Use MUST_COALESCE_COST - 1
cost for in_lto_p.
* gcc.dg/lto/pr60404_0.c: New test.
* gcc.dg/lto/pr60404_1.c: New file.
* gcc.dg/lto/pr60404_2.c: New file.
Paulo Matos [Tue, 4 Mar 2014 11:45:06 +0000 (12:45 +0100)]
tree-streamer.c (record_common_node): Assert we don't record nodes with type double.
2014-03-04 Paulo Matos <paulo@matos-sorge.com>
* tree-streamer.c (record_common_node): Assert we don't record
nodes with type double.
(preload_common_node): Skip type double, complex double and
double pointer since it is now frontend dependent due to
fshort-double option.
Richard Biener [Tue, 4 Mar 2014 11:25:50 +0000 (11:25 +0000)]
re PR lto/60405 (ICE in lto1 on x86_64-linux-gnu)
2014-03-04 Richard Biener <rguenther@suse.de>
PR lto/60405
* lto-streamer-in.c (lto_read_body): Remove LTO bytecode version
check.
(lto_input_toplevel_asms): Likewise.
* lto-section-in.c (lto_get_section_data): Instead do it here
for every section.
Jerry DeLisle [Tue, 4 Mar 2014 04:33:40 +0000 (04:33 +0000)]
re PR fortran/60148 (strings in NAMELIST do not honor DELIM= in open statement)
2014-03-03 Jerry DeLisle <jvdelisle@gcc.gnu>
PR libfortran/60148
* io/inquire.c (inquire_via_unit): In the case of
DELIM_UNSPECIFIED set inquire return string to "NONE".
* io/list_read.c (read_character): In the case of DELIM_NONE and
namelists, complete the character read using the namelist
variable length.
* io/open.c (new_unit): Don't set delim status to none if not
specified so that DELIM_UNSPECIFIED can be used later.
* io/transfer.c (data_transfer_init): For namelist I/O, if the
unit delim status is unspecified set the current status to quote.
Otherwise, set current status to the unit status.
* io/unit.c (get_internel_unit, init_unit): Remember to set
flags_delim initially to DELIM_UNSPECIFIED so defaults come out
correctly.
* io/write.c (write_character): Add a new function argument
"mode" to signify that raw output is to be used vs output with
delimiters. If the mode is set to DELIM (1) proceed with
delimiters. (list_formatted_write_scalar): Write the separator
only if a delimiter was previously specified. Update the call to
write_character with the mode argument given.
(namelist_write_newline): Use the mode argument. (nml_write_obj):
Use the mode argument. Remove use of tmp_delim. Write the
semi-colon or comma correctly only when needed with using
delimiters. Cleanup whitespace.
(namelist_write): If delim is not specified in namelist I/O,
default to using quotes. Get rid of the tmp_delim variable and
use the new mode argument in write_character.
Bill Schmidt [Mon, 3 Mar 2014 20:16:52 +0000 (20:16 +0000)]
rs6000.c (rs6000_preferred_reload_class): Disallow reload of PLUS rtx's outside of GENERAL_REGS or BASE_REGS...
2014-03-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/rs6000.c (rs6000_preferred_reload_class): Disallow
reload of PLUS rtx's outside of GENERAL_REGS or BASE_REGS; relax
constraint on constants to permit them being loaded into
GENERAL_REGS or BASE_REGS.
* c-pragma.c (c_pp_lookup_pragma): Handle PRAGMA_CILK_SIMD.
(init_pragma): Call cpp_register_deferred_pragma for PRAGMA_CILK_SIMD
even when flag_preprocess_only.
* c-c++-common/cilk-plus/PS/vectorlength-2.c: New test.
* c-c++-common/cilk-plus/PS/vectorlength-3.c: New test.
Jakub Jelinek [Mon, 3 Mar 2014 07:25:50 +0000 (08:25 +0100)]
re PR middle-end/60175 (ICE on gcc.dg/asan/nosanitize-and-inline.c)
PR middle-end/60175
* function.c (expand_function_end): Don't emit
clobber_return_register sequence if clobber_after is a BARRIER.
* cfgexpand.c (construct_exit_block): Append instructions before
return_label to prev_bb.