+2018-10-03 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/86109
+ * coverage.c (coverage_begin_function): Do not
+ mark lambdas as artificial.
+ * tree-core.h (struct GTY): Remove tm_clone_flag
+ and introduce new lambda_function.
+ * tree.h (DECL_LAMBDA_FUNCTION): New macro.
+
2018-10-02 Aaron Sawdey <acsawdey@linux.ibm.com>
PR target/87474
gcov_write_string (IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl)));
gcov_write_unsigned (DECL_ARTIFICIAL (current_function_decl)
- && !DECL_FUNCTION_VERSIONED (current_function_decl));
+ && !DECL_FUNCTION_VERSIONED (current_function_decl)
+ && !DECL_LAMBDA_FUNCTION (current_function_decl));
gcov_write_filename (xloc.file);
gcov_write_unsigned (xloc.line);
gcov_write_unsigned (xloc.column);
+2018-10-03 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/86109
+ * parser.c (cp_parser_lambda_declarator_opt):
+ Set DECL_LAMBDA_FUNCTION for lambdas.
+
2018-10-02 Richard Biener <rguenther@suse.de>
* name-lookup.c (check_local_shadow): Do not test DECL_FROM_INLINE.
DECL_ARTIFICIAL (fco) = 1;
/* Give the object parameter a different name. */
DECL_NAME (DECL_ARGUMENTS (fco)) = closure_identifier;
+ DECL_LAMBDA_FUNCTION (fco) = 1;
}
if (template_param_list)
{
+2018-10-03 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/86109
+ * g++.dg/gcov/pr86109.C: New test.
+
2018-10-02 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/tree-ssa/muldiv-1.c: New file.
--- /dev/null
+
+/* { dg-options "-fprofile-arcs -ftest-coverage -std=c++11" } */
+/* { dg-do run { target native } } */
+
+int main()
+{
+ auto partially_uncovered_lambda = [](int i) { /* count(1) */
+ if (i > 10) /* count(1) */
+ return 0; /* count(1) */
+ return 1; /* count(#####) */
+ };
+
+ return partially_uncovered_lambda(20); /* count(1) */
+}
+
+/* { dg-final { run-gcov pr86109.C } } */
unsigned pure_flag : 1;
unsigned looping_const_or_pure_flag : 1;
unsigned has_debug_args_flag : 1;
- unsigned tm_clone_flag : 1;
unsigned versioned_function : 1;
+ unsigned lambda_function: 1;
/* No bits left. */
};
#define DECL_CXX_DESTRUCTOR_P(NODE)\
(FUNCTION_DECL_CHECK (NODE)->decl_with_vis.cxx_destructor)
+/* In FUNCTION_DECL, this is set if this function is a lambda function. */
+#define DECL_LAMBDA_FUNCTION(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->function_decl.lambda_function)
+
/* In FUNCTION_DECL that represent an virtual method this is set when
the method is final. */
#define DECL_FINAL_P(NODE)\