Bill Allombert on Thu, 08 Mar 2012 17:39:04 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: GCC 4.6.3 miscompiles PARI on OS X PPC


On Wed, Mar 07, 2012 at 10:25:23AM +0100, Jeroen Demeyer wrote:
> Work-around:
> 
> 
> diff -ru src/src/language/init.c src.patched/src/language/init.c
> --- src/src/language/init.c     2012-02-11 10:57:38.000000000 +0100
> +++ src.patched/src/language/init.c     2012-03-07 10:24:37.000000000 +0100
> @@ -593,14 +593,16 @@
>  pari_init_functions(void)
>  {
>    stack_init(&s_MODULES, sizeof(*MODULES),(void**)&MODULES);
> -  stack_pushp(&s_MODULES,functions_basic);
>    stack_init(&s_OLDMODULES, sizeof(*OLDMODULES),(void**)&OLDMODULES);
> -  stack_pushp(&s_OLDMODULES,oldfonctions);
>    functions_hash = (entree**) pari_calloc(sizeof(entree*)*functions_tblsz);
>    pari_fill_hashtable(functions_hash,
>                        new_fun_set? functions_basic: oldfonctions);
>    defaults_hash = (entree**) pari_calloc(sizeof(entree*)*functions_tblsz);
>    pari_add_defaults_module(functions_default);
> +  /* Move this down to work around GCC bug
> +   * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49330 */
> +  stack_pushp(&s_MODULES,functions_basic);
> +  stack_pushp(&s_OLDMODULES,oldfonctions);
>  }

This is similar to the one I have posted in 
<http://pari.math.u-bordeaux.fr/archives/pari-dev-1202/msg00006.html>

Cheers,
Bill.