Bug with static __attribute__((always_inline))

Calling a function declared with static attribute((always_inline)) from within the interpreter will only work once. Subsequent attempts will result in an ‘undefined symbol’ error from IncrementalExecutor::executeFunction. Though it is still defined if called from another function (I’m assuming because it was actually inlined).

[code]/*

  1. bin/cling -DTESTDECL=“inline”
  2. bin/cling -DTESTDECL=“attribute((always_inline))”
  3. bin/cling -DTESTDECL=“static attribute((always_inline))”

#include "test.h"
TESTgetValue();
TESTgetValue(); // 3. Fails (unresolved symbol)

#include "test.h"
test();
test();
TESTgetValue(); // 3. fails
test(); // Still works

#include "test.h"
TESTgetValue();
test(); // 3 fails
*/

#include <stdio.h>

TESTDECL void TESTgetValue()
{
printf(“A\n”);
}

static void test() {
TESTgetValue();
TESTgetValue();
}[/code]

Hi,

Thanks for opening sft.its.cern.ch/jira/browse/ROOT-8225 - we’ll track progress there!

Axel,