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

            Bug ID: 68031
           Summary: cc1 crashes when compiling newlib / mktm_r.c
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mihail.popa at gmail dot com
  Target Milestone: ---

Created attachment 36550
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36550&action=edit
Preprocessed source file

Compile attached file with:

gcc -O2 -g3 -S -c -xc lib_a-mkrtm_r.i

cc1 will crash with stack:

0xadb875 crash_signal
        ../../src/gcc/toplev.c:353
0x817f97 tree_class_check
        ../../src/gcc/tree.h:3055
0x817f97 tree_single_nonnegative_warnv_p(tree_node*, bool*, int)
        ../../src/gcc/fold-const.c:13025
0x87ae93 gimple_phi_nonnegative_warnv_p
        ../../src/gcc/gimple-fold.c:6239
0x87ae93 gimple_stmt_nonnegative_warnv_p(gimple*, bool*, int)
        ../../src/gcc/gimple-fold.c:6264
0x818de4 tree_expr_nonnegative_p(tree_node*)
        ../../src/gcc/fold-const.c:13325
0xe89502 gimple_simplify_108
        /tmp/mihailpo/master_x86/build/gcc/gimple-match.c:5116
0xe8a463 gimple_simplify_TRUNC_MOD_EXPR
        /tmp/mihailpo/master_x86/build/gcc/gimple-match.c:24762
0xe5fb3e gimple_simplify
        /tmp/mihailpo/master_x86/build/gcc/gimple-match.c:34389

Appears to be triggered by:

2015-10-19  Richard Biener  <rguent...@suse.de>

        * gimple-fold.c (gimple_phi_nonnegative_warnv_p): New function.
        (gimple_stmt_nonnegative_warnv_p): Use it.
        * match.pd (CPROJ): New operator list.
        (cproj (complex ...)): Move simplifications from ...
        * builtins.c (fold_builtin_cproj): ... here.

Reply via email to