Bug 45792 - [4.6 Regression]: cris-elf build failure (hangs) due to fix for PR44374
Summary: [4.6 Regression]: cris-elf build failure (hangs) due to fix for PR44374
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Hans-Peter Nilsson
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords: build, patch
Depends on:
Blocks:
 
Reported: 2010-09-25 16:49 UTC by Hans-Peter Nilsson
Modified: 2010-09-27 19:58 UTC (History)
1 user (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: cris-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-09-25 22:14:30


Attachments
Preprocessed dtoa.c (8.56 KB, text/plain)
2010-09-25 16:49 UTC, Hans-Peter Nilsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Nilsson 2010-09-25 16:49:49 UTC
Created attachment 21882 [details]
Preprocessed dtoa.c

At r164551 the tree built with few regressions.
At r164560 building newlib/libc/stdlib/dtoa.c hangs (cpu-time > 38 hours) and at r164619 the build is at a similar state (didn't wait 38 hours, but see below).

Attaching a gdb-session to the running cc1 at r164619 shows an infinite loop in
gcc/emit-rtl.c:reorder_insns:

4027          for (x = from; x != NEXT_INSN (to); x = NEXT_INSN (x))
4028            if (!BARRIER_P (x))
4029              df_insn_change_bb (x, bb);

But "x" is bogus; it seems to have been deleted or at least removed from the insn stream:
(insn 2210 2210 2210 239 (set (cc0)
        (compare (reg/v/f:SI 3 r3 [orig:95 mlo ] [95])
            (reg/v/f:SI 4 r4 [orig:97 mhi ] [97]))) /tmp/hpautotest-gcc1/gcc/newlib/libc/stdlib/dtoa.c:808 11 {*cmpsi}
     (nil))

The call to df_insn_change_bb takes the (old_bb == new_bb) early return.

Author of suspect patch in revision range CC:ed.
Preprocessed dtoa.c attached.  Compile with -O2.
Comment 1 Hans-Peter Nilsson 2010-09-25 22:14:30 UTC
FWIW I had a private report that it also happens with host i686-darwin9 target cris-elf, at r165605.
Comment 2 Hans-Peter Nilsson 2010-09-27 09:16:59 UTC
I'd better take it, now that I have a patch.  Bernd, I certainly don't mind if you grab this PR for yourself, definitely if you don't like the patch.
Comment 3 Bernd Schmidt 2010-09-27 09:32:14 UTC
Looking at it now.
Comment 4 Hans-Peter Nilsson 2010-09-27 17:34:15 UTC
For the record, updated patch URL to point to Bernds patch.
Comment 5 Hans-Peter Nilsson 2010-09-27 19:55:31 UTC
Author: hp
Date: Mon Sep 27 19:55:29 2010
New Revision: 164663

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164663
Log:
	PR rtl-optimization/45792
	* cfgcleanup.c (try_head_merge_bb): New rtx vector nextptr.
	If not all insns are to be merged, for each edge, stash the
	next candidate after the to-be-merged insns before doing the
	merge, and use them for the retry at the new insertion point.
	Handle CC0 targets when retrying.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgcleanup.c
Comment 6 Hans-Peter Nilsson 2010-09-27 19:58:07 UTC
committed