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

            Bug ID: 79536
           Summary: ICE in fold_binary_loc, at fold-const.c:9060
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

Affects versions down to at least 4.8 (on x86_64 GNU/Linux) :


$ cat z1.c
typedef int A;
void fn1 (A x, A y)
{
  if ( (x+(x-y)*1i) != -(-x+(y-x)*1i) );
}


$ gcc-7-20170212 -c z1.c
z1.c: In function 'fn1':
z1.c:4:3: internal compiler error: in fold_binary_loc, at fold-const.c:9060
   if ( (x+(x-y)*1i) != -(-x+(y-x)*1i) );
   ^~
0x8fc0af fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fold-const.c:9057
0x904faa fold_build2_stat_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fold-const.c:12242
0x90ff0a fold_negate_expr
        ../../gcc/fold-const.c:583
0x910517 negate_expr
        ../../gcc/fold-const.c:735
0x8fa3de fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fold-const.c:9522
0x904faa fold_build2_stat_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fold-const.c:12242
0x90fc4c fold_negate_expr
        ../../gcc/fold-const.c:625
0x906c95 fold_unary_loc(unsigned int, tree_code, tree_node*, tree_node*)
        ../../gcc/fold-const.c:7827
0x916f4c fold(tree_node*)
        ../../gcc/fold-const.c:11875
0x6e36ea c_fully_fold_internal
        ../../gcc/c/c-fold.c:412
0x6e492b c_fully_fold(tree_node*, bool, bool*)
        ../../gcc/c/c-fold.c:90
0x69c7fa build_binary_op(unsigned int, tree_code, tree_node*, tree_node*, int)
        ../../gcc/c/c-typeck.c:11752
0x69d836 parser_build_binary_op(unsigned int, tree_code, c_expr, c_expr)
        ../../gcc/c/c-typeck.c:3633
0x6bae1a c_parser_binary_expression
        ../../gcc/c/c-parser.c:6818
0x6bb2b5 c_parser_conditional_expression
        ../../gcc/c/c-parser.c:6458
0x6bba10 c_parser_expr_no_commas
        ../../gcc/c/c-parser.c:6375
0x6bbc92 c_parser_expression
        ../../gcc/c/c-parser.c:8597
0x6be519 c_parser_expression_conv
        ../../gcc/c/c-parser.c:8630
0x6be592 c_parser_condition
        ../../gcc/c/c-parser.c:5421
0x6be627 c_parser_paren_condition
        ../../gcc/c/c-parser.c:5440

Reply via email to