Bug 65573 - 13908.C:20:33: internal compiler error: in cp_build_addr_expr_1, at cp/typeck.c:5527
Summary: 13908.C:20:33: internal compiler error: in cp_build_addr_expr_1, at cp/typeck...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 97826 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-03-25 21:40 UTC by Rainer Emrich
Modified: 2023-09-04 19:15 UTC (History)
3 users (show)

See Also:
Host: x86_64-w64-mingw32
Target: x86_64-w64-mingw32
Build: x86_64-w64-mingw32
Known to work:
Known to fail:
Last reconfirmed: 2015-03-26 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Emrich 2015-03-25 21:40:32 UTC
Running the g++ testsuite I get the following ICE:

Executing on host: /opt/devel/SCRATCH/tmp.5jnZ8G4weh/gcc-5.0.0/gcc-5.0.0/gcc/testsuite/g++/../../xg++ -B/opt/devel/SCRATCH/tmp.5jnZ8G4weh/gcc-5.0.0/gcc-5.0.0/gcc/testsuite/g++/../../  -fno-diagnostics-show-caret -fdiagnostics-color=never  -nostdinc++ -I/opt/devel/SCRATCH/tmp.5jnZ8G4weh/gcc-5.0.0/gcc-5.0.0/x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32 -I/opt/devel/SCRATCH/tmp.5jnZ8G4weh/gcc-5.0.0/gcc-5.0.0/x86_64-w64-mingw32/libstdc++-v3/include -I/opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libstdc++-v3/libsupc++ -I/opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libstdc++-v3/include/backward -I/opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libstdc++-v3/testsuite/util -fmessage-length=0  -std=c++98  -pedantic-errors -Wno-long-long  -c   -o 13908.o /opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/gcc/testsuite/g++.old-deja/g++.benjamin/13908.C    (timeout = 300)
spawn /opt/devel/SCRATCH/tmp.5jnZ8G4weh/gcc-5.0.0/gcc-5.0.0/gcc/testsuite/g++/../../xg++ -B/opt/devel/SCRATCH/tmp.5jnZ8G4weh/gcc-5.0.0/gcc-5.0.0/gcc/testsuite/g++/../../ -fno-diagnostics-show-caret -fdiagnostics-color=never -nostdinc++ -I/opt/devel/SCRATCH/tmp.5jnZ8G4weh/gcc-5.0.0/gcc-5.0.0/x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32 -I/opt/devel/SCRATCH/tmp.5jnZ8G4weh/gcc-5.0.0/gcc-5.0.0/x86_64-w64-mingw32/libstdc++-v3/include -I/opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libstdc++-v3/libsupc++ -I/opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libstdc++-v3/include/backward -I/opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libstdc++-v3/testsuite/util -fmessage-length=0 -std=c++98 -pedantic-errors -Wno-long-long -c -o 13908.o /opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/gcc/testsuite/g++.old-deja/g++.benjamin/13908.C
D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/gcc/testsuite/g++.old-deja/g++.benjamin/13908.C: In function 'void bar(chile*, pmf)':
D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/gcc/testsuite/g++.old-deja/g++.benjamin/13908.C:20:33: internal compiler error: in cp_build_addr_expr_1, at cp/typeck.c:5527
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
compiler exited with status 1
output is:
D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/gcc/testsuite/g++.old-deja/g++.benjamin/13908.C: In function 'void bar(chile*, pmf)':
D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/gcc/testsuite/g++.old-deja/g++.benjamin/13908.C:20:33: internal compiler error: in cp_build_addr_expr_1, at cp/typeck.c:5527
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

FAIL: g++.old-deja/g++.benjamin/13908.C  -std=c++98 (internal compiler error)
Comment 1 Richard Biener 2015-03-26 10:55:20 UTC
Can you run manually and provide a backtrace?
Comment 2 Kai Tietz 2015-03-26 11:40:14 UTC
Confirmed.

#0  internal_error (
    gmsgid=gmsgid@entry=0x1763f5e <lang_independent_params+3774> "in %s, at %s:%
d") at ../../gcc/gcc/diagnostic.c:1217
#1  0x0125459f in fancy_abort (
    file=file@entry=0x141add5 <gt_ggc_r_gt_cp_rtti_h+437> "../../gcc/gcc/cp/type
ck.c", line=line@entry=5531,
    function=function@entry=0x141da23 <cp_build_addr_expr_1(tree_node*, bool, in
t)::__FUNCTION__> "cp_build_addr_expr_1") at ../../gcc/gcc/diagnostic.c:1291
#2  0x0057ef13 in cp_build_addr_expr_1 (arg=<optimized out>,
    strict_lvalue=<optimized out>, complain=3)
    at ../../gcc/gcc/cp/typeck.c:5531
#3  0x0057f34c in cp_build_addr_expr_strict (complain=3, arg=0xffc90eb8)
    at ../../gcc/gcc/cp/typeck.c:5628
#4  build_x_unary_op (loc=loc@entry=2582, code=code@entry=ADDR_EXPR,
    xarg=0xffc90eb8, complain=complain@entry=3)
    at ../../gcc/gcc/cp/typeck.c:5265
#5  0x005418b2 in cp_parser_unary_expression (parser=parser@entry=0xffeb04b0,
    pidk=<optimized out>, address_p=address_p@entry=22, cast_p=true,
    decltype_p=false) at ../../gcc/gcc/cp/parser.c:7418
#6  0x005420e4 in cp_parser_cast_expression (parser=parser@entry=0xffeb04b0,
    address_p=address_p@entry=false, cast_p=cast_p@entry=true,
    decltype_p=true, decltype_p@entry=false, pidk=pidk@entry=0x0)
    at ../../gcc/gcc/cp/parser.c:8083
#7  0x00542193 in cp_parser_cast_expression (parser=parser@entry=0xffeb04b0,
    address_p=address_p@entry=false, cast_p=cast_p@entry=false,
    decltype_p=decltype_p@entry=false, pidk=pidk@entry=0x0)
    at ../../gcc/gcc/cp/parser.c:8051
#8  0x00542459 in cp_parser_binary_expression (
    parser=parser@entry=0xffeb04b0, cast_p=<optimized out>,
    no_toplevel_fold_p=no_toplevel_fold_p@entry=false,
    decltype_p=decltype_p@entry=false, prec=prec@entry=PREC_NOT_OPERATOR,
    pidk=pidk@entry=0x0) at ../../gcc/gcc/cp/parser.c:8185
#9  0x00542d60 in cp_parser_assignment_expression (
    parser=parser@entry=0xffeb04b0, pidk=pidk@entry=0x0,
    cast_p=cast_p@entry=false, decltype_p=decltype_p@entry=false)
    at ../../gcc/gcc/cp/parser.c:8442
#10 0x005431e6 in cp_parser_constant_expression (parser=0xffeb04b0,
    allow_non_constant_p=<optimized out>, non_constant_p=0xd60a63f)
    at ../../gcc/gcc/cp/parser.c:8688
#11 0x00542ef0 in cp_parser_assignment_expression (
    parser=parser@entry=0xffeb04b0, pidk=pidk@entry=0x0,
    cast_p=cast_p@entry=false, decltype_p=decltype_p@entry=false)
    at ../../gcc/gcc/cp/parser.c:8461
#12 0x00545a56 in cp_parser_expression (parser=parser@entry=0xffeb04b0,
    pidk=pidk@entry=0x0, cast_p=cast_p@entry=false,
    decltype_p=decltype_p@entry=false) at ../../gcc/gcc/cp/parser.c:8596
#13 0x00546267 in cp_parser_expression_statement (
    in_statement_expr=in_statement_expr@entry=0x0)
    at ../../gcc/gcc/cp/parser.c:10005
#14 0x0055e123 in cp_parser_statement (parser=parser@entry=0xffeb04b0,
    in_statement_expr=in_statement_expr@entry=0x0,
    in_compound=in_compound@entry=true, if_p=if_p@entry=0x0)
    at ../../gcc/gcc/cp/parser.c:9854
#15 0x0055f0c1 in cp_parser_statement_seq_opt (
    parser=parser@entry=0xffeb04b0,
    in_statement_expr=in_statement_expr@entry=0x0)
    at ../../gcc/gcc/cp/parser.c:10128
#16 0x0055f1ff in cp_parser_compound_statement (
    parser=parser@entry=0xffeb04b0,
    in_statement_expr=in_statement_expr@entry=0x0, in_try=in_try@entry=false,
    function_body=function_body@entry=true) at ../../gcc/gcc/cp/parser.c:10082
#17 0x0055f45c in cp_parser_function_body (in_function_try_block=false,
    parser=0xffeb04b0) at ../../gcc/gcc/cp/parser.c:19223
#18 cp_parser_ctor_initializer_opt_and_function_body (
    parser=parser@entry=0xffeb04b0,
    in_function_try_block=in_function_try_block@entry=false)
    at ../../gcc/gcc/cp/parser.c:19259
#19 0x00560480 in cp_parser_function_definition_after_declarator (
    parser=parser@entry=0xffeb04b0, inline_p=inline_p@entry=false)
    at ../../gcc/gcc/cp/parser.c:23501
#20 0x00561224 in cp_parser_function_definition_from_specifiers_and_declarator
...

Another case related to -fms-extensions switch. Testcase assume that option is off.  so following patch papers over this issue:

Index: 13908.C
===================================================================
--- 13908.C     (Revision 221690)
+++ 13908.C     (Arbeitskopie)
@@ -1,4 +1,5 @@
 // { dg-do assemble  }
+// { dg-additional-options "-fno-ms-extensions -pedantic" { target *-*-mingw* } }
 // 981203 bkoz
 // g++/13908
Comment 3 Andrew Pinski 2021-07-29 19:30:47 UTC
*** Bug 97826 has been marked as a duplicate of this bug. ***