http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61136

            Bug ID: 61136
           Summary: ice in tree_nop_conversion
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com

Created attachment 32773
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32773&action=edit
gzipped C source code

I just tried to compile the attached code, derived from the Linux kernel,
with flag -O2 on trunk dated 20140509 and it said

mm/slub.c: In function ‘slab_order’:
mm/slub.c:2774:3: internal compiler error: Segmentation fault
   return get_order(size * MAX_OBJS_PER_PAGE) - 1;
   ^
0x98391f crash_signal
    ../../src/trunk/gcc/toplev.c:337
0xb68634 tree_nop_conversion
    ../../src/trunk/gcc/tree.c:11483
0xb68634 tree_strip_nop_conversions
    ../../src/trunk/gcc/tree.c:11534

valgrind says

==21347== Invalid read of size 2
==21347==    at 0xB68634: integer_zerop(tree_node const*) (tree.c:11483)
==21347==    by 0x74C413: multiple_of_p(tree_node*, tree_node const*, tree_node
const*) (fold-const.c:15308)
==21347==    by 0x74C3F8: multiple_of_p(tree_node*, tree_node const*, tree_node
const*) (fold-const.c:15273)
==21347==    by 0x741D02: fold_binary_loc(unsigned int, tree_code, tree_node*,
tree_node*, tree_node*) (fold-const.c:11749)
==21347==    by 0x7434EA: fold_build2_stat_loc(unsigned int, tree_code,
tree_node*, tree_node*, tree_node*) (fold-const.c:14995)
==21347==    by 0x5A69DD: c_fully_fold_internal(tree_node*, bool, bool*, bool*)
(c-common.c:1303)
==21347==    by 0x5A7062: c_fully_fold(tree_node*, bool, bool*)
(c-common.c:1097)
==21347==    by 0x546D04: build_binary_op(unsigned int, tree_code, tree_node*,
tree_node*, int) (c-typeck.c:10953)
==21347==    by 0x54357A: c_objc_common_truthvalue_conversion(unsigned int,
tree_node*) (c-typeck.c:11116)
==21347==    by 0x562671: c_parser_conditional_expression(c_parser*, c_expr*,
tree_node*) (c-parser.c:5962)
==21347==    by 0x5627BB: c_parser_conditional_expression(c_parser*, c_expr*,
tree_node*) (c-parser.c:5982)
==21347==    by 0x562BB0: c_parser_expr_no_commas(c_parser*, c_expr*,
tree_node*) [clone .constprop.45] (c-parser.c:5848)
==21347==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==21347==

Reply via email to