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

            Bug ID: 87886
           Summary: ICE in format_helper, at real.h:227
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

With option -Ofast or -ffast-math, down to at least gcc-5 :


$ cat z1.c
extern double sqrt (x);
int f (int x)
{
  return sqrt(x) < 1.0;
}


$ gcc-9-20181104 -c z1.c -Ofast
z1.c:1:1: warning: parameter names (without types) in function declaration
    1 | extern double sqrt (x);
      | ^~~~~~
z1.c: In function 'f':
z1.c:4:3: internal compiler error: in format_helper, at real.h:227
    4 |   return sqrt(x) < 1.0;
      |   ^~~~~~
0xe5fc01 format_helper::format_helper<machine_mode>(machine_mode const&)
        ../../gcc/real.h:227
0xe5fc01 generic_simplify_47
        <path>/gcc/generic-match.c:2546
0xe6e5d6 generic_simplify_LT_EXPR
        <path>/gcc/generic-match.c:44235
0xeadead generic_simplify(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        <path>/gcc/generic-match.c:52146
0x7ebbce fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fold-const.c:9364
0x7f203a fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fold-const.c:12336
0x62f1f3 c_fully_fold_internal
        ../../gcc/c/c-fold.c:370
0x62fd09 c_fully_fold(tree_node*, bool, bool*, bool)
        ../../gcc/c/c-fold.c:125
0x5f728d c_finish_return(unsigned int, tree_node*, tree_node*)
        ../../gcc/c/c-typeck.c:10252
0x6255b3 c_parser_statement_after_labels
        ../../gcc/c/c-parser.c:5475
0x627060 c_parser_compound_statement_nostart
        ../../gcc/c/c-parser.c:5100
0x6277d6 c_parser_compound_statement
        ../../gcc/c/c-parser.c:4934
0x628f3a c_parser_declaration_or_fndef
        ../../gcc/c/c-parser.c:2347
0x62d113 c_parser_external_declaration
        ../../gcc/c/c-parser.c:1648
0x62dbd9 c_parser_translation_unit
        ../../gcc/c/c-parser.c:1529
0x62dbd9 c_parse_file()
        ../../gcc/c/c-parser.c:18561
0x671e30 c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1150

Reply via email to