Bug 44178 - -fcompare-debug failure with -O1 -fgcse -fsched-pressure -funroll-loops -fschedule-insns
Summary: -fcompare-debug failure with -O1 -fgcse -fsched-pressure -funroll-loops -fsch...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.5.1
Assignee: Not yet assigned to anyone
URL:
Keywords: compare-debug-failure
Depends on: 43332
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-17 21:46 UTC by Zdenek Sojka
Modified: 2022-01-18 23:30 UTC (History)
4 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
reduced testcase (216 bytes, text/plain)
2010-05-17 21:47 UTC, Zdenek Sojka
Details
gcc46-pr44178.patch (706 bytes, patch)
2010-05-19 13:53 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2010-05-17 21:46:05 UTC
Compiler flags:
$ g++ -O1 -fsched-pressure -funroll-loops -fschedule-insns -fcompare-debug testcase.C

Tested revisions:
r159305 - fail
r159045 - fail
r158095 - fail
r153685 - OK
Comment 1 Zdenek Sojka 2010-05-17 21:47:35 UTC
Created attachment 20689 [details]
reduced testcase

$ /mnt/svn/gcc-trunk/binary-159305-lto-fortran/bin/g++ -O1 -fgcse -fsched-pressure -funroll-loops -fschedule-insns -fcompare-debug pr44178.C
g++: pr44178.C: -fcompare-debug failure
Comment 2 Jakub Jelinek 2010-05-19 13:53:28 UTC
Created attachment 20700 [details]
gcc46-pr44178.patch

Untested fix.
Comment 3 Jakub Jelinek 2010-05-20 16:35:06 UTC
Subject: Bug 44178

Author: jakub
Date: Thu May 20 16:34:43 2010
New Revision: 159632

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159632
Log:
	PR debug/44178
	* haifa-sched.c (initiate_bb_reg_pressure_info): Do not call
	setup_ref_regs for DEBUG_INSNs.

	* g++.dg/debug/pr44178.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/debug/pr44178.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/haifa-sched.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Jakub Jelinek 2010-05-20 16:59:34 UTC
Subject: Bug 44178

Author: jakub
Date: Thu May 20 16:58:52 2010
New Revision: 159634

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159634
Log:
	PR debug/44178
	* haifa-sched.c (initiate_bb_reg_pressure_info): Do not call
	setup_ref_regs for DEBUG_INSNs.

	* g++.dg/debug/pr44178.C: New test.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/debug/pr44178.C
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/haifa-sched.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog

Comment 5 Jakub Jelinek 2010-05-20 17:01:21 UTC
Fixed.
Comment 6 Eric Botcazou 2010-06-05 15:34:08 UTC
The testcase doesn't pass on 4.5 branch with RTL checking:

/home/eric/gnat/gnat6_45/src/gcc/testsuite/g++.dg/debug/pr44178.C:39:1: internal compiler error: RTL check: expected elt 3 type 'B', have '0' (rtx barrier) in setup_insn_max_reg_pressure, at haifa-sched.c:1589
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
compiler exited with status 1
Comment 7 Jakub Jelinek 2010-06-05 18:32:36 UTC
That's because of PR43332, which has been fixed just on the trunk, not on 4.5 branch.
Comment 8 Eric Botcazou 2010-06-27 08:32:25 UTC
Fully fixed.