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

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Sam James from comment #6)
> Created attachment 62158 [details]
> pdp11.i

With r16-3298-gfc23b539caa16a, I can't reproduce it:

[hjl@gnu-zen4-1 pr121607]$ cat x.c 
typedef enum
{
  bfd_error_invalid_error_code
} bfd_error_type;
thread_local bfd_error_type bfd_error;
int aout_16_write_syms___trans_tmp_1;
short aout_16_write_syms_g_0_0;
void xvec_0 (long, void *);

typedef struct
{
  int output_section;
} asection;

void bfd_asymbol_section ();

struct pdp11_external_nlist
{
  char e_desc[2];
  char e_type[1];
  char e_ovly[];
} translate_to_native_sym_flags (struct pdp11_external_nlist *sym_pointer)
{
  asection *sec;
  sym_pointer->e_type[0] &= 5;
  bfd_asymbol_section ();
  if (sec == 0)
    {
      bfd_error_type error_tag;
      bfd_error = error_tag;
    }
  if (sec->output_section)
    {
      bfd_error_type error_tag;
      bfd_error = error_tag;
    }
}

bool
aout_16_write_syms (struct d *abfd)
{
  for (; aout_16_write_syms___trans_tmp_1;)
    {
      struct pdp11_external_nlist nsp;
      if (abfd)
        {
          xvec_0 (aout_16_write_syms_g_0_0, nsp.e_desc);
          *nsp.e_ovly = 0;
        }
      else
        *nsp.e_type = 0;
      translate_to_native_sym_flags (&nsp);
    }
}
[hjl@gnu-zen4-1 pr121607]$ make libx.so
/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/ -O2
-fPIC -fno-semantic-interposition   -c -o x.o x.c
x.c: In function ‘translate_to_native_sym_flags’:
x.c:23:1: note: the ABI of passing struct with a flexible array member has
changed in GCC 4.4
   23 | {
      | ^
x.c: At top level:
x.c:40:28: warning: ‘struct d’ declared inside parameter list will not be
visible outside of this definition or declaration
   40 | aout_16_write_syms (struct d *abfd)
      |                            ^
x.c: In function ‘aout_16_write_syms’:
x.c:48:23: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
   48 |           *nsp.e_ovly = 0;
      |           ~~~~~~~~~~~~^~~
x.c:21:8: note: destination object ‘e_ovly’ of size 0
   21 |   char e_ovly[];
      |        ^~~~~~
/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/ -O2
-fPIC -fno-semantic-interposition -shared -o libx.so x.o
[hjl@gnu-zen4-1 pr121607]$

Reply via email to