Hi, Dmitry,

On 4/13/13 2:44 AM, Дмитрий Дьяченко wrote:
Hi!

I have testcase which creduce FAIl to reduce.

But i'm not sure what is the root of the problem
-- may be i incorrectly adopt creduce to new clang (see prev.message)
-- may be there are some (latent) bugs in creduce + clang-trunk +
gcc-4.7 + Fedora 18. And bugs prevent creduce to work correctly

at least, there are indetetminism : i run creduce 2 times and got two
different output files.

I guess you were runnning C-Reduce on a multicore machine and using the default C-Reduce configuration? If so, non-determinism is expected behavior due to the parallel reduction of C-Reduce.

i'm not sure how it may be related to err.messages
from shel-init:getcwd : "getcwd: cannot access parent directories'
or to hang compiler' invocations...

This `getcwd' error is an known issue, which seems related to some perl issue, but we haven't nailed down the exact cause.

i'll try to investigate them. But it'll a different story.

-- may be creduce cant do such transformation

Original .ii file was 14KLOC, after creduce 33 lines, after manual
reduction 6 lines


C-Reduce still needs more improvement on reducing C++ programs. I will check the code and see what I can do for this test case.

Again, Thanks!

- Yang

how to reproduce

1) use clang-current, i use clang version 3.3 (trunk 179456)
2) compile .ii file (see at end of message)
clang++ -fsyntax-only callback.ii

must fail with err.message

callback.ii:5:29: error: cannot initialize a variable of type
'CPC_get_thread_id_Callback *' (aka 'unsigned long (*)()') with an
lvalue of type 'unsigned long ()'
CPC_get_thread_id_Callback *ptr = get_thread_id;
                             ^     ~~~~~~~~~~~~~
1 error generated.

Thank You,
Dmitry

creduced callback.ii
--------------------------
extern "C" typedef unsigned long
__attribute__ ((regparm (0))) CPC_get_thread_id_Callback ();
typedef struct
{
     CPC_get_thread_id_Callback *get_thread_id;
}
CPC_LOG_CONFIG;
struct A
{
     CPC_LOG_CONFIG logConfig;
};
typedef struct
{
     A CSPConfig;
}
PrivatePlugIn;
extern "C" typedef struct
{
     int fSMP;
     int nCPUs;
}
CPC_LFMM_CONFIG;
PrivatePlugIn *PI (int *);
unsigned long get_thread_id ();
int
do_init ()
{
     int *plg;
     CPC_LFMM_CONFIG memcfg;
     memcfg.nCPUs = memcfg.fSMP ? : 0;
     PI (plg)->CSPConfig.logConfig.get_thread_id = get_thread_id;
     return 0;
}
--------------------------

manually reduced
---------------------------
extern "C" typedef unsigned long
__attribute__ ((regparm (0))) CPC_get_thread_id_Callback ();

unsigned long get_thread_id ();

CPC_get_thread_id_Callback *ptr = get_thread_id;
--------------------------

2013/4/5 Yang Chen<[email protected]>:
Thanks, Dmitry!

- Yang


Дмитрий Дьяченко wrote:
Hi,

To build current creduce from Git with current clang from trunk it's
needed for me 4 additional patches:

follow API changes
- clang_delta/RemoveNamespace.cpp
- clang_delta/Transformation.cpp
- clang_delta/TransformationManager.cpp

follow changes in include-files' layout
- m4/ax_llvm.m4

creduce-Git : today, branch master
llvm+clang: today, trunk, clang version 3.3 (trunk 178679)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Fedora 18 / x86_64

Modified creduce
- PASS tests/run_tests
- successfully reduce 4Mb .ii into 2Kb

Thanks,
Dmitry



Reply via email to