------- Comment #2 from dave at hiauly1 dot hia dot nrc dot ca  2007-01-16 
01:47 -------
Subject: Re:  FAIL: gfortran.dg/enum_2.f90  -O  (internal compiler error)

> ------- Comment #1 from kargl at gcc dot gnu dot org  2007-01-16 00:54 -------
> \> 0x003e75d8 in __gmpz_add_ui ()
> > (gdb) bt
> > #0  0x003e75d8 in __gmpz_add_ui ()
> > #1  0x0003402c in gfc_enum_initializer (last_initializer=0x400817a8, where=
> >       {nextc = 0x0, lb = 0x0}) at ../../gcc/gcc/fortran/arith.c:2475
> 
> Is your source up to date?  arith.c contains 2447 lines of code.

Yes.

# svn diff arith.c
# wc arith.c
 2493  6785 59118 arith.c

The call is here:

  if (last_initializer != NULL)
    {
      mpz_add_ui (result->value.integer, last_initializer->value.integer, 1);

Note, that this is 4.1.2.

> > Dump of assembler code from 0x3e75c8 to 0x3e75e8:
> > 0x003e75c8 <__gmpz_add_ui+104>: ldw -70(sp),r3
> > 0x003e75cc <__gmpz_add_ui+108>: bv r0(rp)
> > 0x003e75d0 <__gmpz_add_ui+112>: ldw,mb -80(sp),r7
> > 0x003e75d4 <__gmpz_add_ui+116>: cmpib,>,n 0,r4,0x3e76d4 <__gmpz_add_ui+372>
> > 0x003e75d8 <__gmpz_add_ui+120>: ldw 0(r25),ret0
> > 0x003e75dc <__gmpz_add_ui+124>: add,l r5,ret0,ret0
> > 0x003e75e0 <__gmpz_add_ui+128>: cmpb,>>= ret0,r5,0x3e769c 
> > <__gmpz_add_ui+316>
> > 0x003e75e4 <__gmpz_add_ui+132>: stw ret0,0(r22)
> > 
> 
> This suggests that you have a broken GMP, which isn't a gfortran problem.

We have for gmpz_add_ui in gmp.h:

#define mpz_add_ui __gmpz_add_ui
__GMP_DECLSPEC void mpz_add_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long
int));

typedef __mpz_struct *mpz_ptr;
typedef __gmp_const __mpz_struct *mpz_srcptr;

Looking at the code in __gmpz_add_ui, it would appear that there is a
problem with the _mp_d field in the struct (i.e., null value).  As this
has to be setup before the call and the call is from gfortran, it's not
clear that this is a GMP problem.

I started a new build so I can't debug this further until it completes.

Dave


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30478

Reply via email to