[PATCH] D111009: Update inline builtin handling to honor gnu inline attribute

Manoj Gupta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 16 12:26:42 PDT 2021


manojgupta added a comment.

I am noticing a clang crash with ToT after this change.

- testcase --

  long a;
  char b, d;
  extern inline __attribute__((always_inline))
  __attribute__((gnu_inline)) unsigned long
  strlen() {
    return a;
  }
  c(void) {
    strlen(&b);
    return 0;
  }
  unsigned long strlen() { return d; }

  bin/clang -x c foo.c -Wno-error
  foo.c:8:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
  c(void) {
  ^
  Global is external, but doesn't have external or weak linkage!
  i64 (i8*)* @strlen.inline
  fatal error: error in backend: Broken module found, compilation aborted!
  clang version 14.0.0 (https://github.com/llvm/llvm-project.git 3129aa5caf1f9b5c48ab708f43cb3fc5173dd021)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111009/new/

https://reviews.llvm.org/D111009



More information about the cfe-commits mailing list