User account creation filtered due to spam.

Bug 44469 - [4.5/4.6 Regression] internal compiler error: in fixup_reorder_chain, at cfglayout.c:797
Summary: [4.5/4.6 Regression] internal compiler error: in fixup_reorder_chain, at cfgl...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.5.0
: P2 normal
Target Milestone: 4.5.3
Assignee: Eric Botcazou
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2010-06-08 14:44 UTC by Siarhei Siamashka
Modified: 2011-02-02 17:54 UTC (History)
7 users (show)

See Also:
Host:
Target: armv7l-unknown-linux-gnueabi
Build:
Known to work:
Known to fail: 4.5.1, 4.5.2
Last reconfirmed: 2010-07-07 19:43:32


Attachments
testcase.i (127 bytes, text/plain)
2010-06-08 14:45 UTC, Siarhei Siamashka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Siarhei Siamashka 2010-06-08 14:44:36 UTC
Target: armv7l-unknown-linux-gnueabi
Configured with: ../gcc-4_5-branch/configure --prefix=/home/ssvb/gcc-test/bin --target=armv7l-unknown-linux-gnueabi --enable-languages=c --without-headers
Thread model: posix
gcc version 4.5.1 20100607 (prerelease) (GCC)

$ armv7l-unknown-linux-gnueabi -O2 testcase.i
testcase.i: In function ‘a’:
testcase.i:15:1: internal compiler error: in fixup_reorder_chain, at cfglayout.c:797
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

This bug prevents bootstrap on ARM when configured with '--disable-checking' option.
Also see PR42347 comment 28
Comment 1 Siarhei Siamashka 2010-06-08 14:45:22 UTC
Created attachment 20868 [details]
testcase.i
Comment 2 Jakub Jelinek 2010-06-09 12:51:48 UTC
I guess for empty bbs with no successor where the predecessor ends in an conditional jump without side-effects try_optimize_cfg can't do just delete_basic_block, but needs to call some function to actually adjust the conditional jump into unconditional.  Perhaps try_redirect_by_replacing_jump or something similar.
Comment 3 Jakub Jelinek 2010-06-09 13:55:54 UTC
There are more issues:
1) cleanup_barriers seems to do weird things with these empty bbs from
__builtin_unreachable (), I guess it shouldn't reorder anything if prev is a
LABEL_P
2) the reason why this compiles fine on x86_64 seems to be in different bb reordering.  On arm the empty bb is reordered after the condjump, which means
its label is deleted by /* Remove code labels no longer used.  */ in try_optimize_cfg and then the block is trivially empty.  On x86_64 we don't ICE, but generate useless code:
        movl    (%rdi), %eax
        testl   %eax, %eax
        je      .L2
        cmpl    $1, %eax
        jne     .L3
        movq    %rdi, %rsi
.L2:
        xorl    %eax, %eax
        cmpb    $0, (%rsi)
        sete    %al
        ret
.L3:
        .cfi_endproc

I'd say we shouldn't try to delete just trivially_empty_bb_p's, but also ones
that before the bb note also have labels and after it nothing or only DEBUG_INSNs, but we should delete only if we actually succeed adjusting the jump insn at the end of the earlier block.
Comment 4 Richard Biener 2010-06-24 21:40:33 UTC
Seems to be confirmed at least.
Comment 5 Richard Biener 2010-07-31 09:29:53 UTC
GCC 4.5.1 is being released, adjusting target milestone.
Comment 6 Richard Biener 2010-12-16 13:03:35 UTC
GCC 4.5.2 is being released, adjusting target milestone.
Comment 7 Eric Botcazou 2011-01-26 15:02:49 UTC
Testing a fix.
Comment 8 Eric Botcazou 2011-01-26 21:12:01 UTC
Author: ebotcazou
Date: Wed Jan 26 21:11:57 2011
New Revision: 169304

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169304
Log:
	PR rtl-optimization/44469
	* cfgcleanup.c (try_optimize_cfg): Iterate in CFG layout mode too
	after removing trivially dead basic blocks.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/20110126-1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgcleanup.c
    trunk/gcc/testsuite/ChangeLog
Comment 9 Eric Botcazou 2011-01-26 21:14:34 UTC
Author: ebotcazou
Date: Wed Jan 26 21:14:27 2011
New Revision: 169305

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169305
Log:
	PR rtl-optimization/44469
	* cfgcleanup.c (try_optimize_cfg): Iterate in CFG layout mode too
	after removing trivially dead basic blocks.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/compile/20110126-1.c
      - copied unchanged from r169304, trunk/gcc/testsuite/gcc.c-torture/compile/20110126-1.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/cfgcleanup.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
Comment 10 Eric Botcazou 2011-01-26 21:17:06 UTC
In the upcoming 4.5.x releases.
Comment 11 Diego Novillo 2011-02-02 17:54:49 UTC
Author: dnovillo
Date: Wed Feb  2 17:54:41 2011
New Revision: 169629

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169629
Log:
	PR rtl-optimization/44469
	* cfgcleanup.c (try_optimize_cfg): Iterate in CFG layout mode too
	after removing trivially dead basic blocks.

Added:
    branches/google/integration/gcc/testsuite/gcc.c-torture/compile/20110126-1.c
Modified:
    branches/google/integration/gcc/ChangeLog
    branches/google/integration/gcc/cfgcleanup.c
    branches/google/integration/gcc/testsuite/ChangeLog