You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -132,9 +132,13 @@ fn prefix_and_suffix<'tcx>(
132
132
133
133
let attrs = tcx.codegen_fn_attrs(instance.def_id());
134
134
let link_section = attrs.link_section.map(|symbol| symbol.as_str().to_string());
135
-
let align = attrs.alignment.map(|a| a.bytes()).unwrap_or(4);
136
135
137
-
// See https://sourceware.org/binutils/docs/as/ARM-Directives.html for info on these directives.
136
+
// function alignment can be set globally with the `-Zmin-function-alignment=<n>` flag;
137
+
// the alignment from a `#[repr(align(<n>))]` is used if it specifies a higher alignment.
138
+
// if no alignment is specified, an alignment of 4 bytes is used.
139
+
let min_function_alignment = tcx.sess.opts.unstable_opts.min_function_alignment;
140
+
let align = Ord::max(min_function_alignment, attrs.alignment).map(|a| a.bytes()).unwrap_or(4);
141
+
138
142
// In particular, `.arm` can also be written `.code 32` and `.thumb` as `.code 16`.
0 commit comments