about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src
AgeCommit message (Collapse)AuthorLines
2022-11-15Auto merge of #102570 - cjgillot:deagg-debuginfo, r=oli-obkbors-8/+49
Perform simple scalar replacement of aggregates (SROA) MIR opt This is a re-open of https://github.com/rust-lang/rust/pull/85796 I copied the debuginfo implementation (first commit) from `@eddyb's` own SROA PR. This pass replaces plain field accesses by simple locals when possible. To be eligible, the replaced locals: - must not be enums or unions; - must not be used whole; - must not have their address taken. The storage and deinit statements are duplicated on each created local. cc `@tmiasko` who reviewed the former version of this PR.
2022-11-15Introduce composite debuginfo.Camille GILLOT-8/+49
2022-11-15Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obkbors-2/+2
interpret: support for per-byte provenance Also factors the provenance map into its own module. The third commit does the same for the init mask. I can move it in a separate PR if you prefer. Fixes https://github.com/rust-lang/miri/issues/2181 r? `@oli-obk`
2022-11-15Use custom entry name in gccAyush Singh-4/+5
This is a continuation of 9f0a8620bd7d325e6d42417b08daff3e55cb88f6 for gcc. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-13add is_sized method on Abi and Layout, and use itRalf Jung-1/+1
2022-11-12Allow actual AVX512-related feature names in the case of some misleading aliasesCaleb Zulawski-4/+4
2022-11-06fix cranelift and gccRalf Jung-2/+2
2022-11-06Add type_array to BaseTypeMethodsAyush Singh-21/+21
Moved type_array function to rustc_codegen_ssa::BaseTypeMethods trait. This allows using normal alloca function to create arrays as suggested in https://github.com/rust-lang/rust/pull/104022. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-10-31Rewrite implementation of `#[alloc_error_handler]`Amanieu d'Antras-11/+4
The new implementation doesn't use weak lang items and instead changes `#[alloc_error_handler]` to an attribute macro just like `#[global_allocator]`. The attribute will generate the `__rg_oom` function which is called by the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom` function is defined in any crate then the compiler shim will call `__rdl_oom` in the alloc crate which will simply panic. This also fixes link errors with `-C link-dead-code` with `default_alloc_error_handler`: `__rg_oom` was previously defined in the alloc crate and would attempt to reference the `oom` lang item, even if it didn't exist. This worked as long as `__rg_oom` was excluded from linking since it was not called. This is a prerequisite for the stabilization of `default_alloc_error_handler` (#102318).
2022-10-24Support raw-dylib functions being used inside inlined functionsDaniel Paoliello-0/+1
2022-10-23Migrate all diagnosticsNilstrieb-23/+23
2022-10-02Remove type argument of array_alloca and rename to byte_array_allocabjorn3-1/+1
2022-10-02Remove dynamic_alloca from BuilderMethodsbjorn3-4/+0
2022-10-01Merge apply_attrs_callsite into call and invokebjorn3-13/+32
Some codegen backends are not able to apply callsite attrs after the fact.
2022-10-01Remove unused target_cpu and tune_cpu methods from ExtraBackendMethodsbjorn3-9/+0
2022-10-01Remove several unused methods from MiscMethodsbjorn3-16/+0
2022-10-01Remove unused Context assoc type from WriteBackendMethodsbjorn3-1/+0
2022-09-28print <signal> when ranlib failed without an exit codeEllis Hoag-1/+1
2022-09-26lint and remove unused diagnosticEllis Hoag-6/+4
2022-09-24remove commentEllis Hoag-1/+0
2022-09-24fix lifetime errorEllis Hoag-29/+3
2022-09-24rebase and update trait namesEllis Hoag-25/+25
2022-09-24impl SessionDiagnostic for LayoutError and Spanned<T>Ellis Hoag-1/+18
2022-09-24Add monomorphization errorsEllis Hoag-153/+261
2022-09-24lint typeEllis Hoag-1/+1
2022-09-24Add wrapper type for ExitCode for use in RanlibFailureEllis Hoag-2/+24
2022-09-24remove IntoDiagnosticArg impl for OptionEllis Hoag-2/+2
2022-09-24Lint against untranslatable diagnostics in rustc_codegen_gccEllis Hoag-0/+2
2022-09-24Add LayoutSizeOverflowEllis Hoag-2/+11
2022-09-24Add LTONotSupportedEllis Hoag-1/+6
2022-09-24Add UnwindingInlineAsmEllis Hoag-1/+9
2022-09-24Add LinkageConstOrMutTypeEllis Hoag-4/+10
2022-09-24Add RanlibFailureEllis Hoag-1/+12
2022-09-06Remove dead broken code from const zst handling in backendsOli Scherer-4/+0
2022-08-30Rollup merge of #100653 - cuviper:fptoint_sat, r=michaelwoerister,antoyoDylan DPC-5/+170
Move the cast_float_to_int fallback code to GCC Now that we require at least LLVM 13, that codegen backend is always using its intrinsic `fptosi.sat` and `fptoui.sat` conversions, so it doesn't need the manual implementation. However, the GCC backend still needs it, so we can move all of that code down there.
2022-08-30Rollup merge of #101101 - RalfJung:read-pointer-as-bytes, r=oli-obkDylan DPC-6/+6
interpret: make read-pointer-as-bytes a CTFE-only error with extra information Next step in the reaction to https://github.com/rust-lang/rust/issues/99923. Also teaches Miri to implicitly strip provenance in more situations when transmuting pointers to integers, which fixes https://github.com/rust-lang/miri/issues/2456. Pointer-to-int transmutation during CTFE now produces a message like this: ``` = help: this code performed an operation that depends on the underlying bytes representing a pointer = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported ``` r? ``@oli-obk``
2022-08-28Auto merge of #96946 - WaffleLapkin:ptr_mask, r=scottmcmbors-0/+12
Add pointer masking convenience functions This PR adds the following public API: ```rust impl<T: ?Sized> *const T { fn mask(self, mask: usize) -> *const T; } impl<T: ?Sized> *mut T { fn mask(self, mask: usize) -> *const T; } // mod intrinsics fn mask<T>(ptr: *const T, mask: usize) -> *const T ``` This is equivalent to `ptr.map_addr(|a| a & mask)` but also uses a cool llvm intrinsic. Proposed in https://github.com/rust-lang/rust/pull/95643#issuecomment-1121562352 cc `@Gankra` `@scottmcm` `@RalfJung` r? rust-lang/libs-api
2022-08-27interpret: rename relocation → provenanceRalf Jung-6/+6
2022-08-26Move `ArgAbi::pad_i32` into `PassMode::Cast`.Nicholas Nethercote-11/+12
Because it's only needed for that variant. This shrinks the types and clarifies the logic.
2022-08-26Turn `ArgAbi::pad` into a `bool`.Nicholas Nethercote-2/+2
Because it's only ever set to `None` or `Some(Reg::i32())`.
2022-08-26Simplify arg capacity calculations.Nicholas Nethercote-19/+3
Currently they try to be very precise. But they are wrong, i.e. they don't match what's happening in the loop below. This code isn't hot enough for it to matter that much.
2022-08-26Change `FnAbi::args` to a boxed slice.Nicholas Nethercote-1/+1
2022-08-26Box `CastTarget` within `PassMode`.Nicholas Nethercote-5/+5
Because `PassMode::Cast` is by far the largest variant, but is relatively rare. This requires making `PassMode` not impl `Copy`, and `Clone` is no longer necessary. This causes lots of sigil adjusting, but nothing very notable.
2022-08-21Fix `ptr_mask` impl in cg gccMaybe Waffle-1/+11
2022-08-21Implement `ptr_mask` intrinsic in cg gccMaybe Waffle-0/+2
2022-08-16Move the cast_float_to_int fallback code to GCCJosh Stone-5/+170
Now that we require at least LLVM 13, that codegen backend is always using its intrinsic `fptosi.sat` and `fptoui.sat` conversions, so it doesn't need the manual implementation. However, the GCC backend still needs it, so we can move all of that code down there.
2022-07-28Introduce an ArchiveBuilderBuilderbjorn3-27/+34
This avoids monomorphizing all linker code for each codegen backend and will allow passing in extra information to the archive builder from the codegen backend.
2022-07-28Inline inject_dll_import_libbjorn3-4/+0
2022-07-28Move output argument from ArchiveBuilder::new to .build()bjorn3-11/+7
2022-07-26Auto merge of #98989 - dpaoliello:rawdylibbin, r=michaelwoeristerbors-2/+10
Enable raw-dylib for bin crates Fixes #93842 When `raw-dylib` is used in a `bin` crate, we need to collect all of the `raw-dylib` functions, generate the import library and add that to the linker command line. I also changed the tests so that 1) the C++ dlls are created after the Rust dlls, thus there is no chance of accidentally using them in the Rust linking process and 2) disabled generating import libraries when building with MSVC.