public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/50708] New: Infinite loop between rshift_double and lshift_double if count is LONG_MIN
@ 2011-10-12 20:27 rmansfield at qnx dot com
  2011-10-13  9:27 ` [Bug middle-end/50708] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: rmansfield at qnx dot com @ 2011-10-12 20:27 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50708
           Summary: Infinite loop between rshift_double and lshift_double
                    if count is LONG_MIN
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rmansfield@qnx.com
                CC: rguenther@suse.de
              Host: i686-unknown-linux-gnu
            Target: arm-unknown-linux-gnu
             Build: i686-unknown-linux-gnu


rshift_double() has 

  if (count < 0)
    {
      lshift_double (l1, h1, -count, prec, lv, hv, arith);
      return;
    }

and lshift_double() has:

  if (count < 0)
    {
      rshift_double (l1, h1, -count, prec, lv, hv, arith);
      return;
    }

so when count = LONG_MIN, count and -count are the same and end up calling each
forever, or until the process runs out of stack.

The backtrace shows the issue:

<snip>

#189 0x082e6cac in rshift_double (l1=1, h1=0, count=-2147483648, prec=32,
lv=0xbfdb53ac, hv=0xbfdb53b0, arith=1 '\001') at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/double-int.c:267
#190 0x082e6b28 in lshift_double (l1=1, h1=0, count=-2147483648, prec=32,
lv=0xbfdb53ac, hv=0xbfdb53b0, arith=1 '\001') at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/double-int.c:204
#191 0x082e6cac in rshift_double (l1=1, h1=0, count=-2147483648, prec=32,
lv=0xbfdb53ac, hv=0xbfdb53b0, arith=1 '\001') at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/double-int.c:267
#192 0x082e6b28 in lshift_double (l1=1, h1=0, count=-2147483648, prec=32,
lv=0xbfdb53ac, hv=0xbfdb53b0, arith=1 '\001') at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/double-int.c:204
#193 0x082e6cac in rshift_double (l1=1, h1=0, count=-2147483648, prec=32,
lv=0xbfdb53ac, hv=0xbfdb53b0, arith=1 '\001') at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/double-int.c:267
#194 0x082e6b28 in lshift_double (l1=1, h1=0, count=-2147483648, prec=32,
lv=0xbfdb53ac, hv=0xbfdb53b0, arith=1 '\001') at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/double-int.c:204
#195 0x082e7fd5 in double_int_lshift (a={low = 1, high = 0}, count=-2147483648,
prec=32, arith=1 '\001') at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/double-int.c:886
#196 0x083a9572 in int_const_binop (code=LSHIFT_EXPR, arg1=0x12a58c,
arg2=0x84d730) at /home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/fold-const.c:975
#197 0x083a9f2e in const_binop (code=LSHIFT_EXPR, arg1=0x12a58c, arg2=0x84d730)
at /home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/fold-const.c:1104
#198 0x084065f4 in fold_binary_loc (loc=0, code=LSHIFT_EXPR, type=0x13e360,
op0=0x12a58c, op1=0x84d730) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/fold-const.c:9517
#199 0x08889d8d in fully_constant_expression (e=0xaaf9204) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/tree-ssa-pre.c:1177
#200 0x0888ab34 in phi_translate_1 (expr=0xaaf9204, set1=0xaaf8830, set2=0x0,
pred=0xb57700, phiblock=0xb3d4c0) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/tree-ssa-pre.c:1511
#201 0x0888c05a in phi_translate (expr=0xaaf5690, set1=0xaaf8830, set2=0x0,
pred=0xb57700, phiblock=0xb3d4c0) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/tree-ssa-pre.c:1843
#202 0x0888c21e in phi_translate_set (dest=0xaaf8d70, set=0xaaf8830,
pred=0xb57700, phiblock=0xb3d4c0) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/tree-ssa-pre.c:1877
#203 0x0888de46 in compute_partial_antic_aux (block=0xb57700,
block_has_abnormal_pred_edge=0 '\0') at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/tree-ssa-pre.c:2449
#204 0x0888e7d7 in compute_antic () at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/tree-ssa-pre.c:2622
#205 0x08897841 in execute_pre (do_fre=0 '\0') at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/tree-ssa-pre.c:4898
#206 0x0889794e in do_pre () at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/tree-ssa-pre.c:4946
#207 0x085fe0e3 in execute_one_pass (pass=0x9016c00) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/passes.c:2064
#208 0x085fe50b in execute_pass_list (pass=0x9016c00) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/passes.c:2119
#209 0x085fe527 in execute_pass_list (pass=0x9015fc0) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/passes.c:2120
#210 0x08784f2a in tree_rest_of_compilation (fndecl=0x930a00) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/tree-optimize.c:420
#211 0x0829e503 in cgraph_expand_function (node=0x94f750) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/cgraphunit.c:1805
#212 0x0829e6a6 in cgraph_expand_all_functions () at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/cgraphunit.c:1864
#213 0x0829edf0 in cgraph_optimize () at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/cgraphunit.c:2141
#214 0x0829bc18 in cgraph_finalize_compilation_unit () at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/cgraphunit.c:1312
#215 0x080e729e in c_write_global_declarations () at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/c-decl.c:9940
#216 0x086e8e2f in compile_file () at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/toplev.c:581
#217 0x086eaeec in do_compile () at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/toplev.c:1925
#218 0x086eb069 in toplev_main (argc=125, argv=0xbfdbc134) at
/home/ryan/gnu/gcc/trunk/arm-oabi/../gcc/toplev.c:2001
#219 0x081d9e9a in main (argc=Cannot access memory at address 0x80000000

This happens in:

gcc version 4.7.0 20111012 (experimental) [trunk revision 179835] (GCC) 

I haven't come up with a small reproducible test case just yet..


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-07-06  9:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-12 20:27 [Bug middle-end/50708] New: Infinite loop between rshift_double and lshift_double if count is LONG_MIN rmansfield at qnx dot com
2011-10-13  9:27 ` [Bug middle-end/50708] " rguenth at gcc dot gnu.org
2011-10-29  1:16 ` rmansfield at qnx dot com
2011-10-29 13:30 ` mikpe at it dot uu.se
2011-10-29 14:29 ` rmansfield at qnx dot com
2011-10-30 20:35 ` mikpe at it dot uu.se
2012-03-28 14:26 ` rguenth at gcc dot gnu.org
2012-03-28 14:34 ` rguenth at gcc dot gnu.org
2012-03-29  8:29 ` rguenth at gcc dot gnu.org
2012-03-29  9:32 ` rguenth at gcc dot gnu.org
2012-07-05 14:55 ` rguenth at gcc dot gnu.org
2012-07-06  9:26 ` rguenth at gcc dot gnu.org
2012-07-06  9:27 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).