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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-10-29
            Version|unknown                     |8.2.1
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
It simply runs out of stack (recursing).  Raising the process stack limit with
ulimit -s unlimited makes it work quickly:

> /usr/bin/time gcc-8 t.c
0.22user 0.18system 0:00.40elapsed 99%CPU (0avgtext+0avgdata
352956maxresident)k
0inputs+960outputs (0major+89197minor)pagefaults 0swaps


(gdb) bt
#0  0x0000000001d72282 in LINEMAPS_MACRO_LOWEST_LOCATION (set=0x7ffff7fef000)
    at
/space/rguenther/src/svn/gcc-8-branch/gcc/../libcpp/include/line-map.h:1004
#1  0x0000000001d95d9e in linemap_location_from_macro_expansion_p (
    set=0x7ffff7fef000, location=19837408)
    at /space/rguenther/src/svn/gcc-8-branch/libcpp/line-map.c:1256
#2  0x0000000001d954a1 in linemap_lookup (set=0x7ffff7fef000, line=19837408)
    at /space/rguenther/src/svn/gcc-8-branch/libcpp/line-map.c:946
#3  0x0000000001d94104 in pure_location_p (set=0x7ffff7fef000, loc=19837408)
    at /space/rguenther/src/svn/gcc-8-branch/libcpp/line-map.c:310
#4  0x0000000001d93bd8 in get_combined_adhoc_loc (set=0x7ffff7fef000, 
    locus=19837408, src_range=..., data=0x0)
    at /space/rguenther/src/svn/gcc-8-branch/libcpp/line-map.c:177
#5  0x00000000013d7e99 in COMBINE_LOCATION_DATA (set=0x7ffff7fef000, 
    loc=19837408, src_range=..., block=0x0)
    at
/space/rguenther/src/svn/gcc-8-branch/gcc/../libcpp/include/line-map.h:1054
#6  0x0000000001d9269a in _cpp_lex_direct (pfile=0x2ba35a0)
    at /space/rguenther/src/svn/gcc-8-branch/libcpp/lex.c:3161
#7  0x0000000001d9106f in _cpp_lex_token (pfile=0x2ba35a0)
    at /space/rguenther/src/svn/gcc-8-branch/libcpp/lex.c:2597
#8  0x0000000001d9c6ad in cpp_get_token_1 (pfile=0x2ba35a0, 
    location=0x7ffff68871ec)
--Type <RET> for more, q to quit, c to continue without paging--
    at /space/rguenther/src/svn/gcc-8-branch/libcpp/macro.c:2718
#9  0x0000000001d9caf7 in cpp_get_token_with_location (pfile=0x2ba35a0, 
    loc=0x7ffff68871ec)
    at /space/rguenther/src/svn/gcc-8-branch/libcpp/macro.c:2904
#10 0x000000000092be5a in c_lex_with_flags (value=0x7ffff68871f0, 
    loc=0x7ffff68871ec, cpp_flags=0x7ffff68871f8 "", lex_flags=0)
    at /space/rguenther/src/svn/gcc-8-branch/gcc/c-family/c-lex.c:403
#11 0x000000000088fbe4 in c_lex_one_token (parser=0x7ffff68871e0, 
    token=0x7ffff68871e8)
    at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:251
#12 0x0000000000890014 in c_parser_peek_token (parser=0x7ffff68871e0)
    at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:435
#13 0x000000000089f512 in c_parser_unary_expression (parser=0x7ffff68871e0)
    at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:7209
#14 0x000000000089ed81 in c_parser_cast_expression (parser=0x7ffff68871e0, 
    after=0x0) at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:7104
#15 0x000000000089f533 in c_parser_unary_expression (parser=0x7ffff68871e0)
    at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:7210
#16 0x000000000089ed81 in c_parser_cast_expression (parser=0x7ffff68871e0, 
    after=0x0) at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:7104
#17 0x000000000089f533 in c_parser_unary_expression (parser=0x7ffff68871e0)
    at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:7210
#18 0x000000000089ed81 in c_parser_cast_expression (parser=0x7ffff68871e0, 
--Type <RET> for more, q to quit, c to continue without paging--
    after=0x0) at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:7104
#19 0x000000000089f533 in c_parser_unary_expression (parser=0x7ffff68871e0)
    at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:7210
#20 0x000000000089ed81 in c_parser_cast_expression (parser=0x7ffff68871e0, 
    after=0x0) at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:7104
#21 0x000000000089f533 in c_parser_unary_expression (parser=0x7ffff68871e0)
    at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:7210
#22 0x000000000089ed81 in c_parser_cast_expression (parser=0x7ffff68871e0, 
...
#41908 0x000000000089ed81 in c_parser_cast_expression (parser=0x7ffff68871e0, 
#41909 0x000000000089d3ae in c_parser_binary_expression (
    parser=0x7ffff68871e0, after=0x0, omp_atomic_lhs=0x0)
    at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:6907
#41910 0x000000000089cb4d in c_parser_conditional_expression (
    parser=0x7ffff68871e0, after=0x0, omp_atomic_lhs=0x0)
    at /space/rguenther/src/svn/gcc-8-branch/gcc/c/c-parser.c:6645
...

I guess it's not easy to avoid this given the structure of the parser.

We are already trying to raise the stack limit to 64MB via stack_limit_increase
().  Maybe we should try raising it even further.

Reply via email to