reassign 627084 gcc-4.6
thanks

Hello Matthias,

I am reassigning this bug back to gcc-4.6 since the relevant code is not 
included in the
pari package in Debian.

I also provide a small test-case (tested with gcc 4.6.1-5).

/usr/bin/gcc  -O2 -Wall -fno-strict-aliasing -I. -I../src/headers -o testcase 
../testcase.c
./testcase
zsh: segmentation fault  sid ./testcase

/usr/bin/gcc  -O2 -Wall -fno-strict-aliasing -fno-inline -I. -I../src/headers 
-o testcase ../testcase.c
./testcase
OK

Thanks a lot for dealing with compiler issues.

Cheers,
-- 
Bill. <[email protected]>

Imagine a large red swirl here. 
#include <stdlib.h>
#include <string.h>

typedef struct {
  long offset;
  size_t size;
} pari_stack;

static pari_stack s_node;
long *pari_tree;

inline void*
pari_realloc(void *pointer, size_t size)
{
  if (!pointer) return malloc(size);
  else return realloc(pointer,size);
}

inline void
stack_init(pari_stack *s, size_t size, void **data)
{
  s->offset = (char *)data-(char *)s;
  *data = NULL;
  s->size = size;
}

inline void
stack_alloc(pari_stack *s, long nb)
{
  void **sdat = (void **) ((char *)s+s->offset);
  *sdat = pari_realloc(*sdat,nb*s->size);
}

void
pari_init_parser(void)
{
  long i;
  const int OPnboperator = 5;

  stack_init(&s_node,sizeof(*pari_tree),(void **)&pari_tree);
  stack_alloc(&s_node,OPnboperator);
  for (i=0;i<OPnboperator;i++)
    pari_tree[i] = 0;
}

int main(void)
{
  pari_init_parser();
  return 0;
}

Reply via email to