Bug 47620 - [4.6 Regression] Profiledbootstrap failure on powerpc-linux
Summary: [4.6 Regression] Profiledbootstrap failure on powerpc-linux
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.6.0
: P1 normal
Target Milestone: 4.6.0
Assignee: Alexandre Oliva
URL:
Keywords:
: 47512 47630 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-06 13:02 UTC by Jakub Jelinek
Modified: 2011-02-19 21:25 UTC (History)
6 users (show)

See Also:
Host:
Target: powerpc64-linux, s390x-linux, mips64-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-02-12 12:49:17


Attachments
ice.i (118.10 KB, text/plain)
2011-02-06 13:02 UTC, Jakub Jelinek
Details
ice.gcda (1.45 KB, application/octet-stream)
2011-02-06 13:02 UTC, Jakub Jelinek
Details
Patch that fixes the bug (444 bytes, patch)
2011-02-12 13:05 UTC, Alexandre Oliva
Details | Diff
ice.i.bz2 (84.23 KB, application/octet-stream)
2011-02-16 23:49 UTC, Jakub Jelinek
Details
ice.gcda (1.36 KB, application/octet-stream)
2011-02-16 23:51 UTC, Jakub Jelinek
Details
Patch that kills the bug harder (359 bytes, patch)
2011-02-17 21:33 UTC, Alexandre Oliva
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2011-02-06 13:02:05 UTC
Created attachment 23255 [details]
ice.i

32-bit powerpc64-linux --with-cpu=default32 bootstrap on the trunk fails with ICE in queue_insn, suspect change are the recent -fcompare-debug scheduler changes.

./cc1 -m32 -g -O2 ice.i -quiet -fprofile-use
../../gcc/cfganal.c: In function ‘find_unreachable_blocks’:
../../gcc/cfganal.c:327:1: internal compiler error: in queue_insn, at haifa-sched.c:1322
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

can be reproduced even with cross-compiler.
Comment 1 Jakub Jelinek 2011-02-06 13:02:56 UTC
Created attachment 23256 [details]
ice.gcda

The corresponding *.gcda file.
Comment 2 Jakub Jelinek 2011-02-06 13:06:32 UTC
Doesn't fail with ./cc1 -m32 -O2 ice.i -quiet -fprofile-use
The ICE is because queue_insn is called with a DEBUG_INSN.
Comment 3 Jakub Jelinek 2011-02-07 09:04:52 UTC
Reverting the r169513 change fixes the ICE.  To reproduce, just a --target=powerpc64-linux --enable-languages=c cross is enough, no need to bother with cross-binutils etc.

Alex, could you please have a look at this?
Comment 4 Jakub Jelinek 2011-02-07 13:45:18 UTC
Also seen on s390x:
https://bugzilla.redhat.com/show_bug.cgi?id=675711
Comment 5 Alexandre Oliva 2011-02-12 12:49:17 UTC
Mine
Comment 6 Alexandre Oliva 2011-02-12 13:05:10 UTC
Created attachment 23317 [details]
Patch that fixes the bug

Here's a patch that fixes the problem.  Jakub, is it easy for you to test it on the affected platforms?  Please? :-)  TIA,
Comment 7 Alexandre Oliva 2011-02-12 13:49:55 UTC
*** Bug 47630 has been marked as a duplicate of this bug. ***
Comment 8 Jakub Jelinek 2011-02-13 15:57:05 UTC
(In reply to comment #6)
> Here's a patch that fixes the problem.  Jakub, is it easy for you to test it on
> the affected platforms?  Please? :-)  TIA,

Profiledootstrapped/regtested on x86_64-linux, i686-linux and powerpc64-linux (64-bit), profiledbootstrapped so far on powerpc-linux (regtest still pending).
Comment 9 Dan Horák 2011-02-14 12:54:59 UTC
build of gcc-4.6.0-0.7.fc15 fails on s390, s390x looks good this time.

gcc-4.6.0-0.5.fc15 is in the buildroot, but the problem is in the freshly built gcc and not in the one from buildroot if I understand it correctly.

for build logs please see http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=302436
Comment 10 Jakub Jelinek 2011-02-16 23:49:56 UTC
Created attachment 23371 [details]
ice.i.bz2

For the s390-linux ICE, which is still present on the current trunk:
bunzip2 ice.i.bz2
../configure --target s390-linux --enable-languages=c
gcc/cc1 -O2 -g -m31 -fprofile-use -march=z9-109 -mtune=z10 ice.i
Comment 11 Jakub Jelinek 2011-02-16 23:51:11 UTC
Created attachment 23372 [details]
ice.gcda

Corresponding ice.gcda.
Comment 12 Jakub Jelinek 2011-02-16 23:54:42 UTC
The ICE happens even with the #c6 patch applied on top of today's trunk.
Comment 13 Jakub Jelinek 2011-02-17 08:18:38 UTC
On s390x-linux the profiledbootstrap actually fails the same way too apparently (again, with #c6 patch applied).
Comment 14 Alexandre Oliva 2011-02-17 21:33:45 UTC
Created attachment 23390 [details]
Patch that kills the bug harder

It turns out that deps from other blocks wouldn't always have tick 0, and debug insns other than the first could have deps other than their immediate preds, that would cause them to be queue for a later tick as well.  But then, why bother?  If all dependencies of a debug insns are met, just add it to the ready set, without even computing the tick it would get from its deps.  Like this patch, that supersedes the earlier on.  Jakub, can you give it a spin on the affected platforms, please?  I'm bootstrapping it on x86_64-linux-gnu and i686-linux-gnu now.
Comment 15 Jakub Jelinek 2011-02-18 10:48:25 UTC
(In reply to comment #14)
> Created attachment 23390 [details]
> Patch that kills the bug harder

While with the previous patch gcc didn't profiledbootstrap on s390-linux, nor apparently s390x-linux and ppc-linux too (yet bootstrap went fine),
with this patch instead of the previous one gcc successfully profiledbootstrapped
on {x86_64,i686,ppc,ppc64,s390,s390x}-linux with no regressions against the bootstrap regtest results without that patch.
Comment 16 Jakub Jelinek 2011-02-19 07:46:47 UTC
*** Bug 47512 has been marked as a duplicate of this bug. ***
Comment 17 Alexandre Oliva 2011-02-19 20:59:27 UTC
Author: aoliva
Date: Sat Feb 19 20:59:23 2011
New Revision: 170324

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170324
Log:
PR debug/47620
PR debug/47630
* haifa-sched.c (fix_tick_ready): Skip tick computation
for debug insns.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/haifa-sched.c
Comment 18 Alexandre Oliva 2011-02-19 21:25:23 UTC
Fixed