Skip to content

Commit 9851a0d

Browse files
committed
Merge tag 'gcc-plugins-v5.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull gcc-plugins fixes from Kees Cook: "GCC 10 fixes for gcc-plugins: - Adjust caller of cgraph_create_edge for GCC 10 argument usage - Update common headers to build under GCC 10 (Frédéric Pierret)" * tag 'gcc-plugins-v5.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: gcc-common.h: Update for GCC 10 gcc-plugins/stackleak: Avoid assignment for unused macro argument
2 parents a16a47e + c752737 commit 9851a0d

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

scripts/gcc-plugins/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ GCC_PLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
44
HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
55
HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
66
HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat
7+
HOST_EXTRACXXFLAGS += -Wno-format-diag
78

89
$(obj)/randomize_layout_plugin.o: $(objtree)/$(obj)/randomize_layout_seed.h
910
quiet_cmd_create_randomize_layout_seed = GENSEED $@

scripts/gcc-plugins/gcc-common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
#include "ggc.h"
3636
#include "timevar.h"
3737

38+
#if BUILDING_GCC_VERSION < 10000
3839
#include "params.h"
40+
#endif
3941

4042
#if BUILDING_GCC_VERSION <= 4009
4143
#include "pointer-set.h"
@@ -847,6 +849,7 @@ static inline gimple gimple_build_assign_with_ops(enum tree_code subcode, tree l
847849
return gimple_build_assign(lhs, subcode, op1, op2 PASS_MEM_STAT);
848850
}
849851

852+
#if BUILDING_GCC_VERSION < 10000
850853
template <>
851854
template <>
852855
inline bool is_a_helper<const ggoto *>::test(const_gimple gs)
@@ -860,6 +863,7 @@ inline bool is_a_helper<const greturn *>::test(const_gimple gs)
860863
{
861864
return gs->code == GIMPLE_RETURN;
862865
}
866+
#endif
863867

864868
static inline gasm *as_a_gasm(gimple stmt)
865869
{

scripts/gcc-plugins/stackleak_plugin.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static void stackleak_add_track_stack(gimple_stmt_iterator *gsi, bool after)
5151
gimple stmt;
5252
gcall *stackleak_track_stack;
5353
cgraph_node_ptr node;
54-
int frequency;
5554
basic_block bb;
5655

5756
/* Insert call to void stackleak_track_stack(void) */
@@ -68,9 +67,9 @@ static void stackleak_add_track_stack(gimple_stmt_iterator *gsi, bool after)
6867
bb = gimple_bb(stackleak_track_stack);
6968
node = cgraph_get_create_node(track_function_decl);
7069
gcc_assert(node);
71-
frequency = compute_call_stmt_bb_frequency(current_function_decl, bb);
7270
cgraph_create_edge(cgraph_get_node(current_function_decl), node,
73-
stackleak_track_stack, bb->count, frequency);
71+
stackleak_track_stack, bb->count,
72+
compute_call_stmt_bb_frequency(current_function_decl, bb));
7473
}
7574

7675
static bool is_alloca(gimple stmt)

0 commit comments

Comments
 (0)