Bug 34085 - ICE with -freorder-blocks-and-partition
Summary: ICE with -freorder-blocks-and-partition
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 34249
  Show dependency treegraph
 
Reported: 2007-11-13 18:20 UTC by revital eres
Modified: 2008-01-15 07:36 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
wrong testcase (please ignore it) (322 bytes, text/plain)
2007-11-13 18:21 UTC, revital eres
Details
the testcase (please ignore the previous testcase it has been uploaded by mistake) (255 bytes, text/plain)
2007-11-13 18:30 UTC, revital eres
Details
File generated by -fprofile-generate (244 bytes, application/octet-stream)
2007-11-15 15:05 UTC, revital eres
Details
gcda file (79 bytes, application/octet-stream)
2007-11-16 06:48 UTC, revital eres
Details
gcno file (with the correct filename) (245 bytes, application/octet-stream)
2007-11-16 06:52 UTC, revital eres
Details

Note You need to log in before you can comment on or make changes to this bug.
Description revital eres 2007-11-13 18:20:31 UTC
When compiling the testacse attached with -O3 -fprofile-use -freorder-blocks-and-partition flags, I get the following error: (I use the profiling information given by first compiling with -fprofile-generate and than running the executable)

tmp.c: In function âmainâ:
tmp.c:36: error: insn 186 outside of basic blocks has non-NULL bb field
tmp.c:36: internal compiler error: verify_flow_info failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

This ICE seems to happen when not all of the bbs are in the same partition (hot/cold).
Comment 1 revital eres 2007-11-13 18:21:52 UTC
Created attachment 14545 [details]
wrong testcase (please ignore it)
Comment 2 Steven Bosscher 2007-11-13 18:24:50 UTC
Can you please also attach your profile information and give the exact compiler revision ID that you used to create that information?  That way, people without access to POWER can still help debug this problem.
Comment 3 revital eres 2007-11-13 18:30:32 UTC
Created attachment 14546 [details]
the testcase (please ignore the previous testcase it has been uploaded by mistake)
Comment 4 revital eres 2007-11-13 18:34:01 UTC
(In reply to comment #2)
> Can you please also attach your profile information and give the exact compiler
> revision ID that you used to create that information?  That way, people without
> access to POWER can still help debug this problem.

Sure - 
gcc version 4.3.0 20071028 (experimental) (GCC)

Comment 5 revital eres 2007-11-15 12:04:50 UTC
It seems that verify_flow_info complains about the following note,
which is generated in the partitioning phase:

(note 234 232 172 11 NOTE_INSN_SWITCH_TEXT_SECTIONS)
Comment 6 Steven Bosscher 2007-11-15 12:21:16 UTC
I can't reproduce this on x86*.
Again, please attach the profile information and state the exact compiler revision you used to generate this profile information.
Comment 7 revital eres 2007-11-15 12:29:08 UTC
(In reply to comment #6)
> I can't reproduce this on x86*.
> Again, please attach the profile information and state the exact compiler
> revision you used to generate this profile information.


Sorry - I am working on r129702.
What do you mean by profile information (a dump file)?

Thanks.
Comment 8 revital eres 2007-11-15 14:17:15 UTC
When disabling rest_of_handle_reorder_blocks (bbro) the ICE disappears. (it seems that it is not caused due to the partitioning - bbpart)
Comment 9 Steven Bosscher 2007-11-15 14:49:28 UTC
I mean the files you generate with -fprofile-generate.

I expect this to be fully blamable on the partitioning code, and I would like to work in fixing this.  But you have to attach the profile information you have generated, or no-one can debug this unless he/she has access to POWER.
Comment 10 revital eres 2007-11-15 15:02:41 UTC
(In reply to comment #9)
> I mean the files you generate with -fprofile-generate.
> I expect this to be fully blamable on the partitioning code, and I would like
> to work in fixing this.  But you have to attach the profile information you
> have generated, or no-one can debug this unless he/she has access to POWER.

Sure, I'll attached the gcno file.
Please let me know if you need more information to retore the ICE.

Thanks
Comment 11 revital eres 2007-11-15 15:05:59 UTC
Created attachment 14556 [details]
File generated by -fprofile-generate
Comment 12 revital eres 2007-11-16 06:48:30 UTC
Created attachment 14562 [details]
gcda file
Comment 13 revital eres 2007-11-16 06:52:20 UTC
Created attachment 14563 [details]
gcno file (with the correct filename)
Comment 14 Steven Bosscher 2007-11-16 21:15:55 UTC
I still can't reproduce it.  What does your gcc -v say?
Comment 15 revital eres 2007-11-17 06:24:22 UTC
(In reply to comment #14)
> I still can't reproduce it.  What does your gcc -v say?

Configured with: ../gcc/configure --prefix=/home/eres/check_final/build --with-cpu=default32 --enable-checking --disable-bootstrap --enable-languages=c
Thread model: posix
gcc version 4.3.0 20071028 (experimental) (GCC)
Comment 16 revital eres 2007-11-17 06:36:24 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > I still can't reproduce it.  What does your gcc -v say?
> Configured with: ../gcc/configure --prefix=/home/eres/check_final/build
> --with-cpu=default32 --enable-checking --disable-bootstrap --enable-languages=c
> Thread model: posix
> gcc version 4.3.0 20071028 (experimental) (GCC)

This bug is reproducable also on updated mainline - r130173 on powerpc64-*-linux.
I run the following sequance to get it:

/home/eres/check_final/build/bin/gcc tmp.c -fprofile-generate -O3
./a.out
 /home/eres/check_final/build/bin/gcc tmp.c -fprofile-use -freorder-blocks-and-partition  -O3
Comment 17 revital eres 2007-11-18 07:32:00 UTC
I reproduced the ICE on x86_64-linux running tmp.c testcase with r130196.
(please make sure you are running tmp.c testcase and not test.c testcase that was uploaded by mistake).

GCC configured with:
 ../gcc/configure --prefix=/home/eres/test_sms/build --enable-checking --enable-bootstrap

here is again the sequence I used for running:

/home/eres/test_sms/build/gcc/xgcc -B/home/eres/test_sms/build/gcc/  tmp.c -fprofile-generate -O3
./a.out
/home/eres/test_sms/build/gcc/xgcc -B/home/eres/test_sms/build/gcc/  tmp.c -fprofile-use -freorder-blocks-and-partition  -O3
Comment 18 patchapp@dberlin.org 2007-11-20 11:45:38 UTC
Subject: Bug number PR rtl-optimization/34085

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-11/msg01050.html
Comment 19 revitale 2007-11-26 12:15:13 UTC
Subject: Bug 34085

Author: revitale
Date: Mon Nov 26 12:15:02 2007
New Revision: 130435

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130435
Log:
Fix PR rtl-optimization/34085

Added:
    trunk/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/bb-reorder.c
    trunk/gcc/testsuite/ChangeLog

Comment 20 Uroš Bizjak 2008-01-15 07:36:21 UTC
The ICE is fixed on mainline.

[The testsuite failure on x86_64 is a separate issue, tracked by PR 34249.]