[all-commits] [llvm/llvm-project] b8e4d4: [PollyACC] Fix implicit function definitions. NFC.

Michael Kruse via All-commits all-commits at lists.llvm.org
Mon May 3 17:18:40 PDT 2021


  Branch: refs/heads/release/12.x
  Home:   https://github.com/llvm/llvm-project
  Commit: b8e4d4eafeded48f3c07797a2d8ccc950394085e
      https://github.com/llvm/llvm-project/commit/b8e4d4eafeded48f3c07797a2d8ccc950394085e
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2021-05-03 (Mon, 03 May 2021)

  Changed paths:
    M polly/lib/External/ppcg/print.c

  Log Message:
  -----------
  [PollyACC] Fix implicit function definitions. NFC.

The isl_id_* have been in used without including the correspodning
isl/id.h header. According to rules in C, a function is defined
implicitly when first used with an assumed int return type (32 bits on
64 bit systems). But the implementation returns a pointer (64 bits on 64
bit systems). Is usually has no consequence because the return value is
stored in a registers that is 64 bits (RAX) and the optimizer does not
truncate its value before using it again as a pointer value. However,
LTO optimizers will be rightfull;y confused.

Fix by including <isl/id.h>

This fixes llvm.org/PR50021

(cherry picked from commit 90e5ce0b0d6b0e72fdc034cbb612f67d67de0fdd)


  Commit: 8b2c019ace3c2e04108b550c5a2b60fc1c63865f
      https://github.com/llvm/llvm-project/commit/8b2c019ace3c2e04108b550c5a2b60fc1c63865f
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2021-05-03 (Mon, 03 May 2021)

  Changed paths:
    M polly/lib/External/ppcg/external.c

  Log Message:
  -----------
  [PollyACC] Fix declaration/stub definition mismatch. NFC.

external.c defines stub functions that are never used because of how
Polly uses PPCG. Unfortunately, they are declared as functions without
return values or parameters which does not match their declarations.
Since they are never called, this was usually not a problem, but an LTO
build gets confused with differently declared functions, or in case of
pet_options_args, a global variable declaration that is defined as a
function

Resolve by including the declaring headers in external.c which forces
the declaration and definition to match at compile-time.

This fixes llvm.org/50021

(cherry picked from commit 89b59345ee29d2cc1afa1f60445916ae2e74be6d)


Compare: https://github.com/llvm/llvm-project/compare/6fe7c3728d1e...8b2c019ace3c


More information about the All-commits mailing list