This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Status of m32c target?


Jeff Law <law@redhat.com> writes:
> A change in reload back in 2016 (IIRC) has effectively made m32c
> unusable.  The limits of the register file create horrible problems for
> reload.
>
> I was going to suggest deprecation for gcc-8 given how badly it was
> broken in gcc-7 and the lack of maintenance on the target.

I gave this another shot Friday, I was thinking maybe we could retire
the m32cm cpu and keep the r8c cpu, since the M32C family is essentially
dead part-wise but there are still new R8C chips being made.

The reload problems for r8c are still there, but I also discovered a bug
in the m32cm cpu that might be generic...

Are there any other targets that push large structures on the call stack
via memcpy?  I'm seeing failures due to mis-calculating stack
adjustments in that case.


$ m32c-elf-gcc -c -mcpu=m32cm -O3 dj.c

typedef struct {
  void *a, *b, *c, *d;
  void *e, *f, *g;
} cookie_io_functions_t;

void *_impure_ptr;

void *
_fopencookie_r (void *ptr, void *cookie, const char *mode, cookie_io_functions_t functions);


void *
fopencookie ( void *cookie , const char *mode , cookie_io_functions_t functions)

{
  return _fopencookie_r ( _impure_ptr , cookie, mode, functions);
}

dj.c: In function ‘fopencookie’:
dj.c:16:10: internal compiler error: in expand_call, at calls.c:4426
   return _fopencookie_r ( _impure_ptr , cookie, mode, functions);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  	  printf("%x %x, %d %d %d\n", flags, ECF_NORETURN, old_stack_allocated, stack_pointer_delta, pending_stack_adjust);
	  /* Verify that we've deallocated all the stack we used.  */
	  gcc_assert ((flags & ECF_NORETURN)
		      || (old_stack_allocated
			  == stack_pointer_delta - pending_stack_adjust));

IIRC when this happens, "stack_pointer_delta" doesn't account for the
size of the large-structure-argument - it has all the push'd args, but
not the memcpy'd one.  I.e. that printf I added prints this:

0 8, 0 12 40


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]