$ gcc -c -g -O -v pkg0017.adb Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.5-20090625/configure --prefix=/opt/gnat/fsf --enable-languages=c,c++,ada --enable-debug Thread model: posix gcc version 4.5.0 20090625 (experimental) (GCC) COLLECT_GCC_OPTIONS='-c' '-g' '-O' '-v' '-mtune=generic' /opt/gnat/fsf/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/gnat1 -quiet -dumpbase pkg0017.adb -auxbase pkg0017 -O -g -mtune=generic pkg0017.adb -o /tmp/cc8cd7gb.s +===========================GNAT BUG DETECTED==============================+ | 4.5.0 20090625 (experimental) (x86_64-unknown-linux-gnu) GCC error: | | in pre_and_rev_post_order_compute, at cfganal.c:1045 | | Error detected around pkg0017.adb:554:7 | | Please submit a bug report; see http://gcc.gnu.org/bugs.html. | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +==========================================================================+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. Consider also -gnatd.n switch (see debug.adb). pkg0017.adb pkg0017.ads pkg001b.ads pkg0003.ads pkg001c.ads pkg000t.ads pkg000w.ads pkg000z.ads pkg000y.ads pkg001a.ads pkg001g.ads pkg0000.ads pkg0015.ads pkg001j.ads pkg0001.ads pkg0007.ads pkg001d.ads pkg0019.ads pkg0006.ads pkg000h.ads pkg000g.ads pkg000d.ads pkg000f.ads pkg000a.ads pkg000e.ads pkg0008.ads pkg000c.ads pkg000p.ads pkg0004.ads pkg000k.ads pkg001q.ads pkg000q.ads pkg000j.ads pkg001x.ads pkg001y.ads pkg000l.ads pkg000n.ads pkg000o.ads pkg001k.ads pkg001l.ads pkg000m.ads pkg001h.ads pkg0014.ads pkg0011.ads pkg001e.ads pkg0016.ads pkg001p.ads pkg0018.ads pkg001f.ads pkg0005.ads pkg001i.ads pkg0013.ads pkg000x.ads pkg0012.ads pkg000v.ads pkg0002.ads pkg000u.ads pkg0002.adb raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:415
Created attachment 18099 [details] source files for reproducing the bug Tried this with i686-linux-gnu and x86_64-linux-gnu and with various 4.5.0 svn trunk versions of June up to 20090628. Only happens when both -g and -O are switched on.
Does not happen with 4.5.0 trunk 20090406 and earlier versions.
My bet would be var-tracking. Can you try if -fno-var-tracking fixes this?
> My bet would be var-tracking. Can you try if -fno-var-tracking fixes this? On the mark. Doesn't happen with -fno-var-tracking
Jakub should maybe know more ;)
While this triggers only with -fvar-tracking, it is var-tracking related only in that vt_find_locations calls pre_and_rev_post_order_compute. The real problem is that there are 2 basic blocks (in my case 220 and 222) that have no predecessors, so aren't reachable from the entry block and therefore gcc_assert (pre_order_num == n_basic_blocks - NUM_FIXED_BLOCKS); assertion fails (pre_order_num is n_basic_blocks - NUM_FIXED_BLOCKS - 2). In *.split3 we have: (insn 4396 853 4397 204 pkg0017.adb:483 (set (mem/c:SF (plus:DI (reg/f:DI 6 bp) (const_int -1668 [0xfffffffffffff97c])) [0 S4 A32]) (reg:SF 21 xmm0 [orig:143 D.79246 ] [143])) 98 {*movsf_1} (expr_list:REG_DEAD (reg:SF 21 xmm0 [orig:143 D.79246 ] [143]) (nil))) (insn 4397 4396 854 204 pkg0017.adb:483 (set (reg:SF 8 st) (mem/c:SF (plus:DI (reg/f:DI 6 bp) (const_int -1668 [0xfffffffffffff97c])) [0 S4 A32])) 98 {*movsf_1} (nil)) (insn 854 4397 862 204 pkg0017.adb:483 (set (reg:XF 9 st(1) [orig:147 D.79250 ] [147]) (float_extend:XF (reg:SF 8 st))) 137 {*extendsfxf2_i387} (expr_list:REG_DEAD (reg:SF 8 st) (expr_list:REG_EH_REGION (const_int 387 [0x183]) (nil)))) ;; End of basic block 204 -> ( 205 220) ... ;; Start of basic block ( 204) -> 220 ;; bb 220 artificial_defs: { d-1(0){ }d-1(1){ }} ;; bb 220 artificial_uses: { u-1(6){ }u-1(7){ }u-1(16){ }u-1(20){ }} ;; lr in 6 [bp] 7 [sp] 16 [argp] 20 [frame] ;; lr use 6 [bp] 7 [sp] 16 [argp] 20 [frame] ;; lr def 0 [ax] 1 [dx] 42 [r13] ;; Pred edge 204 (ab,eh) (code_label 3492 4766 3497 220 941 "" [0 uses]) but in *.stack: (insn 4396 853 4397 204 pkg0017.adb:483 (set (mem/c:SF (plus:DI (reg/f:DI 6 bp) (const_int -1668 [0xfffffffffffff97c])) [0 S4 A32]) (reg:SF 21 xmm0 [orig:143 D.79246 ] [143])) 98 {*movsf_1} (expr_list:REG_DEAD (reg:SF 21 xmm0 [orig:143 D.79246 ] [143]) (nil))) (insn 4397 4396 862 204 pkg0017.adb:483 (set (reg:SF 8 st) (mem/c:SF (plus:DI (reg/f:DI 6 bp) (const_int -1668 [0xfffffffffffff97c])) [0 S4 A32])) 98 {*movsf_1} (nil)) ;; End of basic block 204 -> ( 205) ... ;; Start of basic block () -> 220 ;; bb 220 artificial_defs: { d-1(0){ }d-1(1){ }} ;; bb 220 artificial_uses: { u-1(6){ }u-1(7){ }u-1(16){ }u-1(20){ }} ;; lr in 6 [bp] 7 [sp] 16 [argp] 20 [frame] ;; lr use 6 [bp] 7 [sp] 16 [argp] 20 [frame] ;; lr def 0 [ax] 1 [dx] 42 [r13] (code_label 3492 4766 3497 220 941 "" [0 uses]) So, either the float_extend is considered throwing when it shouldn't (when would float_extend throw? Only for signalling NaN?), or reg-stack.c is forgetting to cleanup the CFG when it removed insns with REG_EH_REGION. In any case it definitely doesn't look like var-tracking.c's fault.
> ------- Comment #2 From Oliver Kellogg 2009-06-30 10:49 [reply] ------- > > Does not happen with 4.5.0 trunk 20090406 and earlier versions. Pardon, the version used was 20090314. Does happen with 20090506 (r147182). Building 20090406 r145578 now.
> Building 20090406 r145578 now. Does not happen there - problem must be between 20090406 and 20090506. Does further narrowing down make sense?
Triggered by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146776
Honza, this is yours.
Does this still happen with current trunk, esp. after the EH rewrite?
> Does this still happen with current trunk, esp. after the EH rewrite? Does not happen with trunk r154034. Thanks.