public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/38722]  New: [4.4 Regression] ICE in find_decomposable_subregs
@ 2009-01-04 14:09 jv244 at cam dot ac dot uk
  2009-01-04 14:10 ` [Bug middle-end/38722] " jv244 at cam dot ac dot uk
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-01-04 14:09 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2539 bytes --]

compiling CP2K at -O1 I get the following ICE:

> gfortran -c -O1 -cpp bug.f90
bug.f90: In function ‘qs_ks_build_kohn_sham_matrix’:
bug.f90:1392: internal compiler error: Segmentation fault

with a trace
Program received signal SIGSEGV, Segmentation fault.
find_decomposable_subregs (px=<value optimized out>, data=0x7fff4c98757c)
    at /data03/vondele/gcc_trunk/gcc/gcc/lower-subreg.c:250
250       if (GET_CODE (x) == SUBREG)
(gdb) bt
#0  find_decomposable_subregs (px=<value optimized out>, data=0x7fff4c98757c)
    at /data03/vondele/gcc_trunk/gcc/gcc/lower-subreg.c:250
#1  0x00000000006eceb1 in for_each_rtx (x=0x20110060, f=0xb60cf0
<find_decomposable_subregs>, data=0x7fff4c98757c)
    at /data03/vondele/gcc_trunk/gcc/gcc/rtlanal.c:2827
#2  0x0000000000b61120 in decompose_multiword_subregs () at
/data03/vondele/gcc_trunk/gcc/gcc/lower-subreg.c:1119
#3  0x0000000000b61ff9 in rest_of_handle_lower_subreg2 () at
/data03/vondele/gcc_trunk/gcc/gcc/lower-subreg.c:1320
#4  0x000000000069c2ad in execute_one_pass (pass=0x10e4d40) at
/data03/vondele/gcc_trunk/gcc/gcc/passes.c:1279
#5  0x000000000069c4f5 in execute_pass_list (pass=0x10e4d40) at
/data03/vondele/gcc_trunk/gcc/gcc/passes.c:1328
#6  0x000000000069c50d in execute_pass_list (pass=0x10dfc00) at
/data03/vondele/gcc_trunk/gcc/gcc/passes.c:1329
#7  0x0000000000792ccc in tree_rest_of_compilation (fndecl=0x7f14440fce00)
    at /data03/vondele/gcc_trunk/gcc/gcc/tree-optimize.c:419
#8  0x00000000009124c4 in cgraph_expand_function (node=0x7f1443c11f00)
    at /data03/vondele/gcc_trunk/gcc/gcc/cgraphunit.c:1047
#9  0x0000000000914225 in cgraph_optimize () at
/data03/vondele/gcc_trunk/gcc/gcc/cgraphunit.c:1106
#10 0x000000000048db65 in gfc_be_parse_file (set_yydebug=<value optimized out>)
    at /data03/vondele/gcc_trunk/gcc/gcc/fortran/f95-lang.c:240
#11 0x000000000074357d in toplev_main (argc=<value optimized out>, argv=<value
optimized out>)
    at /data03/vondele/gcc_trunk/gcc/gcc/toplev.c:970
#12 0x00007f1444431436 in __libc_start_main () from /lib64/libc.so.6
#13 0x0000000000402bf9 in _start ()

I'll be working on a testcase


-- 
           Summary: [4.4 Regression] ICE in find_decomposable_subregs
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug middle-end/38722] [4.4 Regression] ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
@ 2009-01-04 14:10 ` jv244 at cam dot ac dot uk
  2009-01-04 14:19 ` jv244 at cam dot ac dot uk
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-01-04 14:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jv244 at cam dot ac dot uk  2009-01-04 14:10 -------
For gcc version 4.4.0 20090104 (experimental) [trunk revision 143050] (GCC)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug middle-end/38722] [4.4 Regression] ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
  2009-01-04 14:10 ` [Bug middle-end/38722] " jv244 at cam dot ac dot uk
@ 2009-01-04 14:19 ` jv244 at cam dot ac dot uk
  2009-01-04 14:20 ` jv244 at cam dot ac dot uk
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-01-04 14:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jv244 at cam dot ac dot uk  2009-01-04 14:19 -------
testcase:

http://www.pci.uzh.ch/vandevondele/tmp/PR38722.tgz

untar, and reproduce with

gfortran -v -c -O1 -cpp bug.f90

If the module files cause problems, I can try to get to a source file only
reproducer. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug middle-end/38722] [4.4 Regression] ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
  2009-01-04 14:10 ` [Bug middle-end/38722] " jv244 at cam dot ac dot uk
  2009-01-04 14:19 ` jv244 at cam dot ac dot uk
@ 2009-01-04 14:20 ` jv244 at cam dot ac dot uk
  2009-01-04 14:26 ` [Bug rtl-optimization/38722] " jv244 at cam dot ac dot uk
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-01-04 14:20 UTC (permalink / raw)
  To: gcc-bugs



-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2009-01-04 14:20 ` jv244 at cam dot ac dot uk
@ 2009-01-04 14:26 ` jv244 at cam dot ac dot uk
  2009-01-04 14:45 ` steven at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-01-04 14:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jv244 at cam dot ac dot uk  2009-01-04 14:26 -------
The ICE only happens at -O1 and not at -O0 or -O2


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2009-01-04 14:26 ` [Bug rtl-optimization/38722] " jv244 at cam dot ac dot uk
@ 2009-01-04 14:45 ` steven at gcc dot gnu dot org
  2009-01-04 14:58 ` jv244 at cam dot ac dot uk
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-01-04 14:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from steven at gcc dot gnu dot org  2009-01-04 14:45 -------
Can you fill in the "known-to-work" field please, if you think this is a
regression?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2009-01-04 14:45 ` steven at gcc dot gnu dot org
@ 2009-01-04 14:58 ` jv244 at cam dot ac dot uk
  2009-01-04 15:13 ` steven at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-01-04 14:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jv244 at cam dot ac dot uk  2009-01-04 14:58 -------
(In reply to comment #2)
> If the module files cause problems, I can try to get to a source file only
> reproducer

 http://www.pci.uzh.ch/vandevondele/tmp/CP2K_2008_12_03.tgz can be used as a
source files only testcase, just change in the Makefile FCFLAGS to

FCFLAGS = -O1 $(DFLAGS)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (5 preceding siblings ...)
  2009-01-04 14:58 ` jv244 at cam dot ac dot uk
@ 2009-01-04 15:13 ` steven at gcc dot gnu dot org
  2009-01-04 15:18 ` jv244 at cam dot ac dot uk
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-01-04 15:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from steven at gcc dot gnu dot org  2009-01-04 15:13 -------
Does not fail for me on i686-pc-cygwin with gcc version 4.4.0 20090103
(experimental) [trunk revision 143030].  What target are you compiling for?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (6 preceding siblings ...)
  2009-01-04 15:13 ` steven at gcc dot gnu dot org
@ 2009-01-04 15:18 ` jv244 at cam dot ac dot uk
  2009-01-04 15:27 ` steven at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-01-04 15:18 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3071 bytes --]



------- Comment #7 from jv244 at cam dot ac dot uk  2009-01-04 15:18 -------
(In reply to comment #6)
> Does not fail for me on i686-pc-cygwin with gcc version 4.4.0 20090103
> (experimental) [trunk revision 143030].  What target are you compiling for?
> 
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /data03/vondele/gcc_trunk/gcc/configure
--prefix=/data03/vondele/gcc_trunk/build --enable-languages=c,fortran
--disable-multilib
Thread model: posix
gcc version 4.4.0 20090104 (experimental) [trunk revision 143050] (GCC)
COLLECT_GCC_OPTIONS='-c' '-ffree-form' '-D__GFORTRAN' '-D__FFTSG'
'-D__COMPILE_ARCH="Linux-x86-64-gfortran"' '-D__COMPILE_DATE="Sat Dec  6
19:17:28 CET 2008"' '-D__COMPILE_HOST="venus"'
'-D__COMPILE_LASTCVS="/xray_diffraction.F/1.24/Wed Dec  3 20:49:04 2008//"'
'-O1' '-v' '-D__GFORTRAN' '-D__FFTSG'
'-D__COMPILE_ARCH="Linux-x86-64-gfortran"' '-D__COMPILE_DATE="Sat Dec  6
19:17:28 CET 2008"' '-D__COMPILE_HOST="venus"'
'-D__COMPILE_LASTCVS="/xray_diffraction.F/1.24/Wed Dec  3 20:49:04 2008//"'
'-mtune=generic'

/data03/vondele/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.4.0/f951
qs_ks_methods.F -cpp /tmp/ccoNXrxb.f90 -quiet -v -D__GFORTRAN -D__FFTSG
-D__COMPILE_ARCH="Linux-x86-64-gfortran" -D__COMPILE_DATE="Sat Dec  6 19:17:28
CET 2008" -D__COMPILE_HOST="venus"
-D__COMPILE_LASTCVS="/xray_diffraction.F/1.24/Wed Dec  3 20:49:04 2008//"
-D__GFORTRAN -D__FFTSG -D__COMPILE_ARCH="Linux-x86-64-gfortran"
-D__COMPILE_DATE="Sat Dec  6 19:17:28 CET 2008" -D__COMPILE_HOST="venus"
-D__COMPILE_LASTCVS="/xray_diffraction.F/1.24/Wed Dec  3 20:49:04 2008//"
qs_ks_methods.F -quiet -dumpbase qs_ks_methods.F -mtune=generic -auxbase
qs_ks_methods -O1 -version -ffree-form -fintrinsic-modules-path
/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/finclude
-o /tmp/ccCuRhVc.s
ignoring nonexistent directory
"/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/finclude
 /usr/local/include
 /data03/vondele/gcc_trunk/build/include
 /data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/include

/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/include-fixed
 /usr/include
End of search list.
GNU Fortran (GCC) version 4.4.0 20090104 (experimental) [trunk revision 143050]
(x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.4.0 20090104 (experimental) [trunk revision
143050], GMP version 4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
qs_ks_methods.F: In function ‘qs_ks_build_kohn_sham_matrix’:
qs_ks_methods.F:1262: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [qs_ks_methods.o] Error 1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (7 preceding siblings ...)
  2009-01-04 15:18 ` jv244 at cam dot ac dot uk
@ 2009-01-04 15:27 ` steven at gcc dot gnu dot org
  2009-01-04 18:21 ` [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes " hjl dot tools at gmail dot com
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-01-04 15:27 UTC (permalink / raw)
  To: gcc-bugs



-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
 GCC target triplet|                            |x86-64-unknown-linux-gnu
   Last reconfirmed|0000-00-00 00:00:00         |2009-01-04 15:27:13
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (8 preceding siblings ...)
  2009-01-04 15:27 ` steven at gcc dot gnu dot org
@ 2009-01-04 18:21 ` hjl dot tools at gmail dot com
  2009-01-04 18:45 ` steven at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-01-04 18:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from hjl dot tools at gmail dot com  2009-01-04 18:21 -------
Revision 143027 is the cause.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl dot tools at gmail dot
                   |                            |com, Kenneth dot Zadeck at
                   |                            |NaturalBridge dot com
            Summary|[4.4 Regression] ICE in     |[4.4 Regression] Revision
                   |find_decomposable_subregs   |143027 causes ICE in
                   |                            |find_decomposable_subregs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (9 preceding siblings ...)
  2009-01-04 18:21 ` [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes " hjl dot tools at gmail dot com
@ 2009-01-04 18:45 ` steven at gcc dot gnu dot org
  2009-01-04 19:51 ` steven at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-01-04 18:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from steven at gcc dot gnu dot org  2009-01-04 18:45 -------
Thanks HJ for looking into this.  I think revision 143027 is not the cause,
it's more likely that it uncovers a latent bug.  I'm trying to reduce Joost's
code to a small test case.  So far, what I'm seeing is that INSN_CODE is wrong
on the insn that causes the ICE.  So some pass is not properly re-recognizing
an insn.  The ICE Joost is seeing is happening in lower_subreg2.

My test case (reduced with delta) ICEs with in IRA's record_operand_cost
because extract_insn is filling recog_data.operands with the wrong information.

I'll accept this for now, while I'm investigating.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |steven at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-01-04 15:27:13         |2009-01-04 18:45:28
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (10 preceding siblings ...)
  2009-01-04 18:45 ` steven at gcc dot gnu dot org
@ 2009-01-04 19:51 ` steven at gcc dot gnu dot org
  2009-01-04 20:02 ` steven at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-01-04 19:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from steven at gcc dot gnu dot org  2009-01-04 19:51 -------
Created an attachment (id=17031)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17031&action=view)
Failing test case (still needs all the .mod files)

This is as far as I can reduce it with delta.

Joost, could you please try to "uninclude" the modules that are still USEd? 
You probably only have to add simplified versions of the modules (e.g. just
interfaces and the types).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (11 preceding siblings ...)
  2009-01-04 19:51 ` steven at gcc dot gnu dot org
@ 2009-01-04 20:02 ` steven at gcc dot gnu dot org
  2009-01-04 21:07 ` steven at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-01-04 20:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from steven at gcc dot gnu dot org  2009-01-04 20:02 -------
Note that this test case ICEs in IRA, but I've checked that it ICEs on the same
insn, and in both cases we're looking at incorrect recog_data.

$ gdb --args ../f951.exe -O t.f90 
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) run
Starting program: /home/Steven_Bosscher/devel/build-x86_64/gcc/f951.exe -O
t.f90
[New thread 6068.0x1710]
[New thread 6068.0x1574]
 qs_ks_build_kohn_sham_matrix
Analyzing compilation unit
Performing interprocedural optimizations
 <visibility> <early_local_cleanups> <summary generate> <inline> <static-var>
<pure-const>Assembling functions:
 qs_ks_build_kohn_sham_matrix
Program received signal SIGSEGV, Segmentation fault.
0x00d8c3f6 in record_operand_costs (insn=0x7fd6a690, op_costs=0x10d46d8,
allocno_pref=0x0) at ../../trunk/gcc/ira-costs.c:953
953           if (GET_CODE (recog_data.operand[i]) == SUBREG)
(gdb) up
#1  0x00d8c854 in scan_one_insn (insn=0x7fd6a690) at
../../trunk/gcc/ira-costs.c:1034
1034      record_operand_costs (insn, op_costs, allocno_pref);
(gdb) p debug_rtx(insn)
(insn 265 200 227 25 t.f90:8 (parallel [
            (set (reg:DI 179)
                (mult:DI (reg:DI 178)
                    (reg:DI 92 [ D.4651 ])))
            (clobber (reg:CC 17 flags))
        ]) 89 {*movdi_1_rex64} (expr_list:REG_DEAD (reg:DI 178)
        (expr_list:REG_DEAD (reg:DI 92 [ D.4651 ])
            (expr_list:REG_UNUSED (reg:CC 17 flags)
                (nil)))))
$1 = void
(gdb) # That is *not* a mov insn
(gdb) # Let's reset INSN_CODE, and re-recog it...
(gdb) set insn.u.fld[6]=-1
(gdb) set insn.u.fld[6] = recog(insn.u.fld[5],insn,0)(gdb) # ...and suddenly
it's a mul insn, as it should be:
(gdb) p debug_rtx(insn)
(insn 265 200 227 25 t.f90:8 (parallel [
            (set (reg:DI 179)
                (mult:DI (reg:DI 178)
                    (reg:DI 92 [ D.4651 ])))
            (clobber (reg:CC 17 flags))
        ]) 332 {*muldi3_1_rex64} (expr_list:REG_DEAD (reg:DI 178)
        (expr_list:REG_DEAD (reg:DI 92 [ D.4651 ])
            (expr_list:REG_UNUSED (reg:CC 17 flags)
                (nil)))))
$10 = void


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (12 preceding siblings ...)
  2009-01-04 20:02 ` steven at gcc dot gnu dot org
@ 2009-01-04 21:07 ` steven at gcc dot gnu dot org
  2009-01-04 21:38 ` steven at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-01-04 21:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from steven at gcc dot gnu dot org  2009-01-04 21:07 -------
This fixes it for me.  However, I'm no RTL expert, and especially combine I
know nothing about :-)

I'll test/post this and see how the RTL guru's judge it.

        * combine.c (try_combine): Adjust INSN_CODE after making a valid
        replacement of an insn's PATTERN.

Index: combine.c
===================================================================
--- combine.c   (revision 143052)
+++ combine.c   (working copy)
@@ -2900,6 +2900,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_dire
                 change to the destination of I3.  This requires us to
                 do a few adjustments.  */

+             INSN_CODE (i3) = insn_code_number;
              PATTERN (i3) = newpat;
              adjust_for_new_dest (i3);
            }


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (13 preceding siblings ...)
  2009-01-04 21:07 ` steven at gcc dot gnu dot org
@ 2009-01-04 21:38 ` steven at gcc dot gnu dot org
  2009-01-04 21:39 ` steven at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-01-04 21:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from steven at gcc dot gnu dot org  2009-01-04 21:38 -------
My patch is wrong.  The changes are reverted by undo_all() later on.  However,
the bug still is in combine.c.  It should not leave insns with the wrong
INSN_CODE.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (14 preceding siblings ...)
  2009-01-04 21:38 ` steven at gcc dot gnu dot org
@ 2009-01-04 21:39 ` steven at gcc dot gnu dot org
  2009-01-05  5:55 ` jv244 at cam dot ac dot uk
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-01-04 21:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from steven at gcc dot gnu dot org  2009-01-04 21:39 -------
Leaving this to an RTL expert.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|steven at gcc dot gnu dot   |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (15 preceding siblings ...)
  2009-01-04 21:39 ` steven at gcc dot gnu dot org
@ 2009-01-05  5:55 ` jv244 at cam dot ac dot uk
  2009-01-05 11:08 ` tkoenig at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-01-05  5:55 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]



------- Comment #15 from jv244 at cam dot ac dot uk  2009-01-05 05:55 -------
Created an attachment (id=17032)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17032&action=view)
testcase without module dependencies

based on Steven's testcase

> gfortran -c -O1 reduced.f90
reduced.f90: In function ‘qs_ks_build_kohn_sham_matrix’:
reduced.f90:16: internal compiler error: Segmentation fault


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (16 preceding siblings ...)
  2009-01-05  5:55 ` jv244 at cam dot ac dot uk
@ 2009-01-05 11:08 ` tkoenig at gcc dot gnu dot org
  2009-01-05 11:33 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2009-01-05 11:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from tkoenig at gcc dot gnu dot org  2009-01-05 11:08 -------
Reduced test case

- works on i686-pc-linux-gnu for all optimization levels

- works with -m32 on x86-64-unknown-linux-gnu

- works with 4.3.2


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|x86-64-unknown-linux-gnu    |
      Known to work|4.3.1                       |4.3.1 4.3.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (17 preceding siblings ...)
  2009-01-05 11:08 ` tkoenig at gcc dot gnu dot org
@ 2009-01-05 11:33 ` rguenth at gcc dot gnu dot org
  2009-01-05 13:11 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-01-05 11:33 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|                            |x86_64-*-*
           Priority|P3                          |P2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (18 preceding siblings ...)
  2009-01-05 11:33 ` rguenth at gcc dot gnu dot org
@ 2009-01-05 13:11 ` jakub at gcc dot gnu dot org
  2009-01-06 20:42 ` jakub at gcc dot gnu dot org
  2009-01-06 20:44 ` jakub at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-05 13:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from jakub at gcc dot gnu dot org  2009-01-05 13:11 -------
Slightly more reduced:
! PR rtl-optimization/38722
! { dg-do compile }
! { dg-options "-O1" }
SUBROUTINE foo(x, n, ga, gc, vr)
  TYPE pt
    DOUBLE PRECISION, DIMENSION (:, :, :), POINTER :: cr
  END TYPE pt
  TYPE pu
    TYPE(pt), POINTER :: pw
  END TYPE pu
  LOGICAL, INTENT(in) :: x, ga, gc
  INTEGER :: i, n
  LOGICAL :: dd, ep, fe
  TYPE(pu) :: vr
  TYPE(pu), DIMENSION(:), POINTER :: v
  IF (.NOT. fe) THEN
     IF (ga) THEN
        CALL bar (dd, ep, gc)
     END IF
     IF (x .AND. .NOT. ga) THEN
        IF (gc) THEN
          DO i=1,n
            CALL baz (v(i), x, gc)
            v(i)%pw%cr = 1.0
          END DO
          DO i=1,n
             IF (ep) THEN
                IF (dd) THEN
                   IF (i==1) THEN
                      v(i)%pw%cr=v(i)%pw%cr + vr%pw%cr
                   ENDIF
                END IF
             END IF
          END DO
        END IF
     ENDIF
  END IF
END SUBROUTINE foo

I'd say the bug is in
              /* If we will be able to accept this, we have made a
                 change to the destination of I3.  This requires us to
                 do a few adjustments.  */

              PATTERN (i3) = newpat;
              adjust_for_new_dest (i3);
being done before last check that might decide to undo_all (and without
recording the changes into undo structures).  A patch which just sets a flag
and does these 2 stmts if the flag is set after the last undo_all cures this,
I'll bootstrap/regtest it soon.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (19 preceding siblings ...)
  2009-01-05 13:11 ` jakub at gcc dot gnu dot org
@ 2009-01-06 20:42 ` jakub at gcc dot gnu dot org
  2009-01-06 20:44 ` jakub at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-06 20:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from jakub at gcc dot gnu dot org  2009-01-06 20:42 -------
Subject: Bug 38722

Author: jakub
Date: Tue Jan  6 20:41:52 2009
New Revision: 143132

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143132
Log:
        PR rtl-optimization/38722
        * combine.c (try_combine): Don't modify PATTERN (i3) and notes
        too early, only set a flag and modify after last possible
        undo_all point.

        * gfortran.dg/pr38722.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr38722.f90
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/combine.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes ICE in find_decomposable_subregs
  2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
                   ` (20 preceding siblings ...)
  2009-01-06 20:42 ` jakub at gcc dot gnu dot org
@ 2009-01-06 20:44 ` jakub at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-06 20:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from jakub at gcc dot gnu dot org  2009-01-06 20:44 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38722


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2009-01-06 20:44 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-04 14:09 [Bug middle-end/38722] New: [4.4 Regression] ICE in find_decomposable_subregs jv244 at cam dot ac dot uk
2009-01-04 14:10 ` [Bug middle-end/38722] " jv244 at cam dot ac dot uk
2009-01-04 14:19 ` jv244 at cam dot ac dot uk
2009-01-04 14:20 ` jv244 at cam dot ac dot uk
2009-01-04 14:26 ` [Bug rtl-optimization/38722] " jv244 at cam dot ac dot uk
2009-01-04 14:45 ` steven at gcc dot gnu dot org
2009-01-04 14:58 ` jv244 at cam dot ac dot uk
2009-01-04 15:13 ` steven at gcc dot gnu dot org
2009-01-04 15:18 ` jv244 at cam dot ac dot uk
2009-01-04 15:27 ` steven at gcc dot gnu dot org
2009-01-04 18:21 ` [Bug rtl-optimization/38722] [4.4 Regression] Revision 143027 causes " hjl dot tools at gmail dot com
2009-01-04 18:45 ` steven at gcc dot gnu dot org
2009-01-04 19:51 ` steven at gcc dot gnu dot org
2009-01-04 20:02 ` steven at gcc dot gnu dot org
2009-01-04 21:07 ` steven at gcc dot gnu dot org
2009-01-04 21:38 ` steven at gcc dot gnu dot org
2009-01-04 21:39 ` steven at gcc dot gnu dot org
2009-01-05  5:55 ` jv244 at cam dot ac dot uk
2009-01-05 11:08 ` tkoenig at gcc dot gnu dot org
2009-01-05 11:33 ` rguenth at gcc dot gnu dot org
2009-01-05 13:11 ` jakub at gcc dot gnu dot org
2009-01-06 20:42 ` jakub at gcc dot gnu dot org
2009-01-06 20:44 ` jakub at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).