https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116378

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
Perhaps there's a need for some target-specific code?
I see entries for Glibc - but nothing for 'posix' or 'windows' - so is the
Glibc code supposed to be generic?

---------

In file included from /src-local/...../system.h:32,
                 from /src-local/....../m2/mc-boot-ch/Glibc.c:23:
/src-local/..../m2/mc-boot-ch/Glibc.c: In function ‘int libc_open(void*, int,
...)’:
/src-local/..../m2/mc-boot-ch/Glibc.c:352:30: warning: ‘mode_t’ {aka ‘short
unsigned int’} is promoted to ‘int’ when passed through ‘...’
  352 |   mode_t mode = va_arg (arg, mode_t);
      | 

and the gimple....

int libc_open (void * p, int oflag)
{
  int D.15836;
  struct  arg[1];
  mode_t mode;
  int result;

  try
    {
      __builtin_va_start (&arg, 0);
      __builtin_trap ();   <<<<<<<<<======== and there it is...
      mode = MEM[(mode_t *)0B];
      _1 = (int) mode;
      result = open (p, oflag, _1);
      __builtin_va_end (&arg);
      D.15836 = result;
      return D.15836;
    }
  finally
    {
      arg = {CLOBBER(eos)};
    }
}

Reply via email to