Bug 41295 - [4.5 Regression] gfortran.dg/loc_2.f90 -O3 -g fails on SH with orphaned debug_insn
Summary: [4.5 Regression] gfortran.dg/loc_2.f90 -O3 -g fails on SH with orphaned debug...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.5.0
: P4 normal
Target Milestone: 4.5.0
Assignee: Alexandre Oliva
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2009-09-07 13:05 UTC by Kazumoto Kojima
Modified: 2009-09-22 18:33 UTC (History)
5 users (show)

See Also:
Host:
Target: sh4-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
minimized testcase (670 bytes, text/plain)
2009-09-08 20:41 UTC, Janis Johnson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kazumoto Kojima 2009-09-07 13:05:35 UTC
After vta merge, gfortran.dg/loc_2.f90 fails on sh4-unknown-linux-gnu
for -O3 -g with

loc_2.f90:114:0: internal compiler error: in reload_combine_note_use, at postreload.c:1097

which is the result of

postreload.c:
1097            gcc_assert (regno < FIRST_PSEUDO_REGISTER);

The problematic regno 1434 came from a debug insn

(debug_insn 1346 1344 1350 3 loc_2.f90:46 (var_location:SI offset (reg:SI 1434 [ ivtmp.132 ])) -1 (nil))

which looks orphaned at postreload pass.  There are no other insns
referring to reg 1434 at that pass.
Comment 1 Richard Biener 2009-09-07 15:39:07 UTC
Debug insns are always "orphaned".
Comment 2 Kazumoto Kojima 2009-09-07 21:27:37 UTC
Ah, then it seems that reload_combine_note_use or its caller should
take account of debug insns.
Comment 3 Janis Johnson 2009-09-08 20:39:47 UTC
I get the same ICE during a 32-bit bootstrap of powerpc64-linux or powerpc-linux.  I'll attach a minimized testcase that shows the error when compiled with cc1 for powerpc-linux.  A 64-bit bootstrap doesn't run into this problem.
Comment 4 Janis Johnson 2009-09-08 20:41:55 UTC
Created attachment 18549 [details]
minimized testcase

cc1 for powerpc-linux gets the ICE when compiling this testcase using -O1 -g.
Comment 5 Pat Haugen 2009-09-09 20:23:02 UTC
Didn't mean to change the component when CC'ing myself, changing back.
Comment 6 Alexandre Oliva 2009-09-22 18:31:47 UTC
Subject: Bug 41295

Author: aoliva
Date: Tue Sep 22 18:31:26 2009
New Revision: 152040

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152040
Log:
gcc/ChangeLog:
PR debug/41295
* reload1.c (reload): Reset debug insns with pseudos without
equivalences.
gcc/testsuite/ChangeLog:
PR debug/41295
* gcc.dg/pr41295.c: New.

Added:
    trunk/gcc/testsuite/gcc.dg/pr41295.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/reload1.c
    trunk/gcc/testsuite/ChangeLog

Comment 7 Alexandre Oliva 2009-09-22 18:33:13 UTC
Fixed.
Comment 8 hjl@gcc.gnu.org 2009-09-28 20:39:43 UTC
Subject: Bug 41295

Author: hjl
Date: Mon Sep 28 20:38:53 2009
New Revision: 152250

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152250
Log:
2009-09-28  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2009-09-26  Andreas Schwab  <schwab@linux-m68k.org>

	PR c/41476
	* gcc.dg/cond-constqual-1.c: New test.

	2009-09-26  Michael Matz  <matz@suse.de>

	PR lto/40758
	PR middle-end/41470
	* gcc.dg/pr41470.c: New test.

	2009-09-23  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/41248
	* gcc.dg/pr41248.c: New.

	2009-09-22  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/41295
	* gcc.dg/pr41295.c: New.

	2009-09-20  Andrew Pinski  <pinskia@gcc.gnu.org>

	PR middle-end/40642
	* g++.dg/torture/pr40642.C: New testcase.

	2009-09-17  Michael Matz  <matz@suse.de>

	PR middle-end/41347
	* gfortran.dg/pr41347.f90: New test.

	2009-09-16  Michael Matz  <matz@suse.de>

	PR fortran/41212
	* gfortran.dg/pr41212.f90: New test.

	2009-09-11  Michael Matz  <matz@suse.de>

	PR middle-end/41275
	* g++.dg/tree-ssa/pr41275.C: New test.

	2009-09-11  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41242
	* gfortran.dg/proc_ptr_comp_21.f90: New.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr40642.C
      - copied unchanged from r152249, trunk/gcc/testsuite/g++.dg/torture/pr40642.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/tree-ssa/pr41275.C
      - copied unchanged from r152249, trunk/gcc/testsuite/g++.dg/tree-ssa/pr41275.C
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/cond-constqual-1.c
      - copied unchanged from r152248, trunk/gcc/testsuite/gcc.dg/cond-constqual-1.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr41248.c
      - copied unchanged from r152248, trunk/gcc/testsuite/gcc.dg/pr41248.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr41295.c
      - copied unchanged from r152249, trunk/gcc/testsuite/gcc.dg/pr41295.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr41470.c
      - copied unchanged from r152248, trunk/gcc/testsuite/gcc.dg/pr41470.c
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/pr41212.f90
      - copied unchanged from r152249, trunk/gcc/testsuite/gfortran.dg/pr41212.f90
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/pr41347.f90
      - copied unchanged from r152249, trunk/gcc/testsuite/gfortran.dg/pr41347.f90
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/proc_ptr_comp_21.f90
      - copied unchanged from r152249, trunk/gcc/testsuite/gfortran.dg/proc_ptr_comp_21.f90
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog