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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-09-08
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, with GCC 11 I see

> gcc-11 -c function_macro_file.c -traditional-cpp
function_macro_file.h:2:1: error: expected '=', ',', ';', 'asm' or
'__attribute__' at end of input
    2 | f
      | ^

I can confirm with GCC 10.  Also with a dev build of GCC 11, but not 12. 
Backtrace there:

#0  0x00007ffff6762c7e in exit () from /lib64/libc.so.6
#1  0x00000000021bd904 in xexit (code=1)
    at ../../src/gcc-11-branch/libiberty/xexit.c:51
#2  0x00000000021bd9e4 in xmalloc_failed (size=9223372036854299649)
    at ../../src/gcc-11-branch/libiberty/xmalloc.c:137
#3  0x00000000021bdaed in xrealloc (oldmem=0x32c9df0, size=9223372036854299649)
    at ../../src/gcc-11-branch/libiberty/xmalloc.c:181
#4  0x000000000217459b in check_output_buffer (pfile=0x3245a80, 
    n=18446744073709234176) at ../../src/gcc-11-branch/libcpp/traditional.c:114
#5  0x0000000002174eb3 in _cpp_scan_out_logical_line (pfile=0x3245a80, 
    macro=0x0, builtin_macro_arg=false)
    at ../../src/gcc-11-branch/libcpp/traditional.c:418
#6  0x0000000002174b4d in _cpp_read_logical_line_trad (pfile=0x3245a80)
    at ../../src/gcc-11-branch/libcpp/traditional.c:321
#7  0x0000000000aff763 in scan_translation_unit_trad (pfile=0x3245a80)
    at ../../src/gcc-11-branch/gcc/c-family/c-ppoutput.c:420
#8  0x0000000000afeb80 in preprocess_file (pfile=0x3245a80)
    at ../../src/gcc-11-branch/gcc/c-family/c-ppoutput.c:97
#9  0x0000000000afcb25 in c_common_init ()
...

#4  0x000000000217459b in check_output_buffer (pfile=0x3245a80, 
    n=18446744073709234176) at ../../src/gcc-11-branch/libcpp/traditional.c:114
114           pfile->out.base = XRESIZEVEC (unsigned char, pfile->out.base,
new_size);
(gdb) l
109       if (n > (size_t) (pfile->out.limit - pfile->out.cur))
110         {
111           size_t size = pfile->out.cur - pfile->out.base;
112           size_t new_size = (size + n) * 3 / 2;
113
114           pfile->out.base = XRESIZEVEC (unsigned char, pfile->out.base,
new_size);
(gdb) up
#5  0x0000000002174eb3 in _cpp_scan_out_logical_line (pfile=0x3245a80, 
    macro=0x0, builtin_macro_arg=false)
    at ../../src/gcc-11-branch/libcpp/traditional.c:418
418       check_output_buffer (pfile, RLIMIT (context) - cur);
(gdb) p *context
$2 = {next = 0x0, prev = 0x0, u = {iso = {first = {token = 0x32aa023, 
        ptoken = 0x32aa023}, last = {token = 0x325c820, ptoken = 0x325c820}}, 
    trad = {cur = 0x32aa023 "\n\n", rlimit = 0x325c820 "\n"}}, buff = 0x0, 
  c = {mc = 0x0, macro = 0x0}, tokens_kind = TOKENS_KIND_INDIRECT}

Reply via email to