[all-commits] [llvm/llvm-project] 1a04a5: [flang] Fix optional assertion in PFTBuilder

Tom Dohrmann via All-commits all-commits at lists.llvm.org
Mon May 15 21:35:00 PDT 2023


  Branch: refs/heads/release/16.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a04a5f1cf15ccf5e0472d495fc47311d9656410
      https://github.com/llvm/llvm-project/commit/1a04a5f1cf15ccf5e0472d495fc47311d9656410
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2023-05-15 (Mon, 15 May 2023)

  Changed paths:
    M flang/lib/Lower/PFTBuilder.cpp
    A flang/test/Lower/pre-fir-tree08.f

  Log Message:
  -----------
  [flang] Fix optional assertion in PFTBuilder

D142279 enabled assertion in libstdc++ and one was triggered
in the PFTBuilder because an optional was access even if it was
null.
This patch fix this issue and add a regression test.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D143589

(cherry picked from commit 3f55311a0afff6278571922e1c23bf5c71dd2d0b)


  Commit: df309b120853cddaa40b863b64a73bfd3b8ec110
      https://github.com/llvm/llvm-project/commit/df309b120853cddaa40b863b64a73bfd3b8ec110
  Author: Tom Dohrmann <erbse.13 at gmx.de>
  Date:   2023-05-15 (Mon, 15 May 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86FrameLowering.cpp
    M llvm/test/CodeGen/X86/x86-64-intrcc.ll

  Log Message:
  -----------
  fix stack probe lowering for x86_intrcc

The x86_intrcc calling convention will build two STACKALLOC_W_PROBING machine instructions if the function takes an error code. This is caused by an additional call to emitSPUpdate in llvm/lib/Target/X86/X86FrameLowering.cpp:1650. Previously only the first STACKALLOC_W_PROBING machine instruction was properly handled, the second one was simply ignored. This lead to miscompilations where the stack pointer wasn't properly updated (see https://github.com/rust-lang/rust/issues/109918). This patch fixes this by handling all STACKALLOC_W_PROBING machine instructions.

To be honest I don't quite understand why this didn't lead to more noticeable miscompilations previously.

This is my first time contributing to LLVM.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D150033

(cherry picked from commit f6154364f65709df234f07ad1fe8799e68d84134)


Compare: https://github.com/llvm/llvm-project/compare/bef3459fcde7...df309b120853


More information about the All-commits mailing list