aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-09-14 15:22:37 +0000
committerGitHub <noreply@github.com>2021-09-14 15:22:37 +0000
commit4493f1c927c79e5b0933d26e9597044790c22f12 (patch)
treef538fb40501e06f3acfe5269d21ba290749697f6 /gcc
parentc8ffaa101c936822f5853a276d530da09c96cf52 (diff)
parent9b95c508298a1deac86f7994366b68833655c70f (diff)
downloadgcc-4493f1c927c79e5b0933d26e9597044790c22f12.zip
gcc-4493f1c927c79e5b0933d26e9597044790c22f12.tar.gz
gcc-4493f1c927c79e5b0933d26e9597044790c22f12.tar.bz2
Merge #673
673: Allow GCC to decide to inline functions is possible r=philberty a=philberty By default the forked GCC wrapper from the go front-end was marking all functions as DECL_UNINLINABLE this changes the behaviour to allow GCC to decide what can be inlined. Fixes #547 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/rust-backend.h5
-rw-r--r--gcc/rust/rust-gcc.cc2
2 files changed, 3 insertions, 4 deletions
diff --git a/gcc/rust/rust-backend.h b/gcc/rust/rust-backend.h
index b6f18f8..a4de0a3 100644
--- a/gcc/rust/rust-backend.h
+++ b/gcc/rust/rust-backend.h
@@ -830,10 +830,9 @@ public:
// the definition will be in another compilation unit.
static const unsigned int function_is_declaration = 1 << 1;
- // Set if the function can be inlined. This is normally set, but is
- // false for functions that may not be inlined because they call
+ // Set if the function should never be inlined because they call
// recover and must be visible for correct panic recovery.
- static const unsigned int function_is_inlinable = 1 << 2;
+ static const unsigned int function_is_uninlinable = 1 << 2;
// Set if the function does not return. This is set for the
// implementation of panic.
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index 0b17865..efc7823 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -3370,7 +3370,7 @@ Gcc_backend::function (Btype *fntype, const std::string &name,
DECL_CONTEXT (resdecl) = decl;
DECL_RESULT (decl) = resdecl;
}
- if ((flags & function_is_inlinable) == 0)
+ if ((flags & function_is_uninlinable) != 0)
DECL_UNINLINABLE (decl) = 1;
if ((flags & function_does_not_return) != 0)
TREE_THIS_VOLATILE (decl) = 1;