Skip to content
Snippets Groups Projects
  1. Jan 31, 2023
    • Ryan Scott's avatar
      Handle `type data` properly in tyThingParent_maybe · 20598ef6
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      Unlike most other data constructors, data constructors declared with `type data`
      are represented in `TyThing`s as `ATyCon` rather than `ADataCon`. The `ATyCon`
      case in `tyThingParent_maybe` previously did not consider the possibility of
      the underlying `TyCon` being a promoted data constructor, which led to the
      oddities observed in #22817. This patch adds a dedicated special case in
      `tyThingParent_maybe`'s `ATyCon` case for `type data` data constructors to fix
      these oddities.
      
      Fixes #22817.
      20598ef6
    • Andreas Klebinger's avatar
      ghc-the-library: Retain cafs in both static in dynamic builds. · 08ba8720
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      We use keepCAFsForGHCi.c to force -fkeep-cafs behaviour by using a
      __attribute__((constructor)) function.
      
      This broke for static builds where the linker discarded the object file
      since it was not reverenced from any exported code. We fix this by
      asserting that the flag is enabled using a function in the same module
      as the constructor. Which causes the object file to be retained by the
      linker, which in turn causes the constructor the be run in static builds.
      
      This changes nothing for dynamic builds using the ghc library. But causes
      static to also retain CAFs (as we expect them to).
      
      Fixes #22417.
      
      -------------------------
      Metric Decrease:
          T21839r
      -------------------------
      08ba8720
  2. Jan 30, 2023
    • Cheng Shao's avatar
      compiler: fix data section alignment in the wasm NCG · da468391
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      Previously we tried to lower the alignment requirement as far as
      possible, based on the section kind inferred from the CLabel. For info
      tables, .p2align 1 was applied given the GC should only need the
      lowest bit to tag forwarding pointers. But this would lead to
      unaligned loads/stores, which has a performance penalty even if the
      wasm spec permits it. Furthermore, the test suite has shown memory
      corruption in a few cases when compacting gc is used.
      
      This patch takes a more conservative approach: all data sections
      except C strings align to word size.
      da468391
    • Ben Gamari's avatar
      nativeGen: Disable asm-shortcutting on Darwin · 8bed166b
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Asm-shortcutting may produce relative references to symbols defined in
      other compilation units. This is not something that MachO relocations
      support (see #21972). For this reason we disable the optimisation on
      Darwin. We do so without a warning since this flag is enabled by `-O2`.
      
      Another way to address this issue would be to rather implement a
      PLT-relocatable jump-table strategy. However, this would only benefit
      Darwin and does not seem worth the effort.
      
      Closes #21972.
      8bed166b
  3. Jan 28, 2023
  4. Jan 27, 2023
  5. Jan 26, 2023
Loading