Kaveh R. GHAZI wrote:
On Fri, 24 Aug 2007, Brian Sidebotham wrote:This ICE is caused by the following patch: 2007-08-10 Kaveh R. Ghazi <[EMAIL PROTECTED]> * system.h (CONST_CAST): New. * c-decl.c (c_make_fname_decl): Use it. * c-lex.c (cb_ident, lex_string): Likewise. * c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise. * gcc.c (set_spec, read_specs, for_each_path, execute, do_spec_1, give_switch, set_multilib_dir): Likewise. * gengtype-parse.c (string_seq, typedef_name): Likewise. * passes.c (execute_one_pass): Likewise. * prefix.c (update_path): Likewise. * pretty-print.c (pp_base_destroy_prefix): Likewise. * tree.c (build_string): Likewise.2007-08-26 Kaveh R. Ghazi <[EMAIL PROTECTED]> * system.h (CONST_CAST): Avoid union for gcc-4.0.x. diff -rup orig/egcc-SVN20070825/gcc/system.h egcc-SVN20070825/gcc/system.h --- orig/egcc-SVN20070825/gcc/system.h 2007-08-10 14:11:38.000000000 -0400 +++ egcc-SVN20070825/gcc/system.h 2007-08-26 12:29:12.577795974 -0400 @@ -774,7 +774,9 @@ extern void fancy_abort (const char *, i execv, et al. Another valid use would be in an allocation function that creates const objects that need to be initialized. Most other cases should be viewed with extreme caution. */ -#ifdef __GNUC__ + +#if defined(__GNUC__) && GCC_VERSION != 4000 +/* GCC 4.0.x has a bug where it may ICE on this expression. */ #define CONST_CAST(X) ((__extension__(union {__typeof(X)_q; void *_v;})(X))._v) #else #define CONST_CAST(X) ((void*)(X))
Hi Kaveh, This patch solves the issue, thanks! Best Regards, Brian Sidebotham.
