Infinite loop in C compiler
Hi,
I'm trying to compile a large C module (about 2MB of C code). It has now been 20h since I've launched the C compilation and it is using 100% of the CPU in the `acomp' process.
I'm compiling the module with the following command line options:
-D__BUILTIN_VA_ARG_INCR -xarch=generic64 -D_REENTRANT -DSOLARIS_THREADS
As you can see no optimizations is enabled.
I can send the necessary files if needed.
Regards,
Manu
Machine info:
Solaris 10 on 64bit AMD opteron.
cc: Sun C 5.8 Patch 121016-01 2006/01/26
# 1
Get the current patches for Sun Studio 11 C compiler and "compiler back end".
http://developers.sun.com/prodtech/cc/downloads/patches/index.jsp
If updating the compiler doesn't fix the problem, you will need to narrow down the test case to something manageable.
If you have a Sun Service contract, you can get help via that channel. Otherwise, you can post a small example here, or file a bug report at bugs.sun.com.
# 2
Thanks, the upgrade to 120759-06 actually fixed my problem.
For information, here is how to reproduce the bug:
file bad.c:
<<
extern void chkinv(char * obj, int where);
struct eif_opt {
short assert_level;
};
typedef char *(*fnptr) (char *, ...);
extern fnptr wfeat_inv(int, int, char *, char *);
extern fnptr wfeat(int, int, int);
extern int is_nested;
extern int is_assert;
void bad_function (char * Current, char * arg1, char * arg2)
{
char * tp1 = 0L ;
char * tp2 = 0L ;
struct eif_opt * opt ;
((void (*) (char * , int , int)) wfeat_inv (2115 , 232 , "set_point_position" , tp1))(tp1, 1, 2);
((void (*) (char * , double , double , char * , char *)) wfeat (3261 , 99 , 10))(Current, 5.0, 5.0, tp1, tp2);
if (is_nested && (((~ (is_assert) & opt->assert_level)) & 0x00000010)) {
chkinv (Current , 1);
}
}
>>
and compiling with cc -xarch=generic64 bad.c
Regards,
Manu