Bug 43740 - [4.5/4.6 Regression] FAIL: gcc.dg/tree-ssa/20031015-1.c (internal compiler error)
Summary: [4.5/4.6 Regression] FAIL: gcc.dg/tree-ssa/20031015-1.c (internal compiler er...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.0
: P2 normal
Target Milestone: 4.5.1
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2010-04-13 01:02 UTC by John David Anglin
Modified: 2010-06-18 00:32 UTC (History)
4 users (show)

See Also:
Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
Build: hppa64-hp-hpux11.11
Known to work:
Known to fail:
Last reconfirmed:


Attachments
gimple-pretty-print.i.gz (118.66 KB, application/x-gunzip)
2010-06-15 13:15 UTC, dave
Details
xxx.sh (348 bytes, application/x-sh)
2010-06-15 13:15 UTC, dave
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2010-04-13 01:02:21 UTC
Executing on host: /mnt/gnu/gcc/objdir/gcc/xgcc -B/mnt/gnu/gcc/objdir/gcc/ /mnt/
gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/20031015-1.c   -O1 -fdump-tree-alias-v
ops -S  -o 20031015-1.s    (timeout = 300)
/mnt/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/20031015-1.c: In function 'main':
/mnt/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/20031015-1.c:9:1: internal compil
er error: Segmentation fault
Comment 1 John David Anglin 2010-04-13 01:17:20 UTC
asm processing is broken causing several tests to fail
for the same reason.
Comment 2 John David Anglin 2010-04-13 01:30:42 UTC
Compiler must be miscompiled as stage1-gcc/cc1 doesn't have fault.

Starting program: /mnt/gnu/gcc/objdir/gcc/cc1 -iprefix /mnt/gnu/gcc/objdir/gcc/../lib/gcc/hppa64-hp-hpux11.11/4.5.0/ -isystem /mnt/gnu/gcc/objdir/gcc/include -isystem /mnt/gnu/gcc/objdir/gcc/include-fixed /mnt/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/20031015-1.c -quiet -dumpbase 20031015-1.c -auxbase-strip 20031015-1.s -O1 -version -fdump-tree-alias-vops -o 20031015-1.s
warning: Private mapping of shared library text was not specified
by the executable; setting a breakpoint in a shared library which
is not privately mapped will not work.  See the HP-UX 11i v3 chatr
manpage for methods to privately map shared library text.
warning: Loadable segment ".tbss" outside of ELF segments
warning: Loadable segment ".tbss" outside of ELF segments
GNU C (GCC) version 4.5.0 20100411 (prerelease) [gcc-4_5-branch revision 158204] (hppa64-hp-hpux11.11)
        compiled by GNU C version 4.5.0 20100411 (prerelease) [gcc-4_5-branch revision 158204], GMP version 4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C (GCC) version 4.5.0 20100411 (prerelease) [gcc-4_5-branch revision 158204] (hppa64-hp-hpux11.11)
        compiled by GNU C version 4.5.0 20100411 (prerelease) [gcc-4_5-branch revision 158204], GMP version 4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 524dd7bb1c7d8a97e70eedfe5581819e

Program received signal SIGSEGV, Segmentation fault.
0x400000000034a3e0 in dump_gimple_stmt (buffer=0x80000001000aedf8, 
    gs=0x800003fffdf9a360, spc=2, flags=576)
    at ../../gcc/gcc/gimple-pretty-print.c:77
77        INDENT (spc);

(gdb) disass 0x400000000034a3d0 0x400000000034a3f0
Dump of assembler code from 0x400000000034a3d0 to 0x400000000034a3f0:
0x400000000034a3d0 <dump_gimple_stmt+7120>:     ldw,s ret0(r19),ret0
0x400000000034a3d4 <dump_gimple_stmt+7124>:     ldd,s ret0(r31),ret0
0x400000000034a3d8 <dump_gimple_stmt+7128>:     cmpb,*= r0,ret0,0x400000000034b8a8 <dump_gimple_stmt+12456>
0x400000000034a3dc <dump_gimple_stmt+7132>:     add,l r6,ret0,ret0
0x400000000034a3e0 <dump_gimple_stmt+7136>:     ldd ret0(r11),r25
0x400000000034a3e4 <dump_gimple_stmt+7140>:     copy dp,r4
0x400000000034a3e8 <dump_gimple_stmt+7144>:     copy r5,r26
0x400000000034a3ec <dump_gimple_stmt+7148>:     copy r8,r24

$2 = Value can't be converted to integer.
(gdb) p/x $r11 
(gdb) p/x $ret0
$4 = 0x800003fffdf9a3b0

Base and index registers are interchanged.

Revision 157955 was ok.
Comment 3 Richard Biener 2010-04-13 10:37:35 UTC
Can you bisect the few commits that happened inbetween?  Like reverting
the fixes for PRs 43679 and/or 43661, 43642?
Comment 4 dave 2010-04-20 22:28:06 UTC
Subject: Re:  [4.5 Regression] FAIL: gcc.dg/tree-ssa/20031015-1.c (internal compiler error)

> Can you bisect the few commits that happened inbetween?  Like reverting
> the fixes for PRs 43679 and/or 43661, 43642?

Strangely, this was introduced in 157991 (change to BASE-VER).

Dave
Comment 5 Richard Biener 2010-04-21 11:49:01 UTC
(In reply to comment #4)
> Subject: Re:  [4.5 Regression] FAIL: gcc.dg/tree-ssa/20031015-1.c (internal
> compiler error)
> 
> > Can you bisect the few commits that happened inbetween?  Like reverting
> > the fixes for PRs 43679 and/or 43661, 43642?
> 
> Strangely, this was introduced in 157991 (change to BASE-VER).

157991 is the change to DEV-PHASE.  That will turn on release-checking by
default which means that tree-checking macros are omitted for dump_gimple_stmt
and thus different code gets generated.  You might want to check if
the same issue can be reproduced on trunk with --enable-checking=release.
And then dig into why dump_gimple_stmt is miscompiled w/o checking.
Comment 6 dave 2010-04-22 13:42:15 UTC
Subject: Re:  [4.5/4.6 Regression] FAIL: gcc.dg/tree-ssa/20031015-1.c (internal compiler error)

The same failures are present on trunk with --enable-checking=release.

Dave
Comment 7 dave 2010-05-02 13:55:57 UTC
Subject: Re:  [4.5/4.6 Regression] FAIL:
	gcc.dg/tree-ssa/20031015-1.c (internal compiler error)

On Tue, 20 Apr 2010, dave at hiauly1 dot hia dot nrc dot ca wrote:

> > Can you bisect the few commits that happened inbetween?  Like reverting
> > the fixes for PRs 43679 and/or 43661, 43642?
> 
> Strangely, this was introduced in 157991 (change to BASE-VER).

With --enable-checking=release, I find that the bug was actually
introduced in revision 151701.

2009-09-14  Richard Henderson  <rth@redhat.com>
            Jakub Jelinek  <jakub@redhat.com>

	* builtins.c (expand_builtin_synchronize): Use gimple_build_asm_vec.
	* cfgbuild.c (make_edges): Handle asm goto.
	...

Dave
Comment 8 John David Anglin 2010-06-15 03:35:00 UTC
Things appear to go wrong in the loop2_invariant pass.  Prior to this pass,
the 'f' flag is not set in the rtx for ivtmp.314.  The first occurence is here:

(insn 1154 1153 1155 103 ../../gcc/gcc/gimple-pretty-print.c:1212 (set (reg/f:DI
 274 [ ivtmp.314 ])
        (plus:DI (reg/f:DI 274 [ ivtmp.314 ])
            (const_int 8 [0x8]))) 160 {*pa.md:4941} (nil))

Setting the 'f' flag allows insn 1208 to be substituted in in insn 1209:

(insn 1208 1207 1209 110 ../../gcc/gcc/gimple.h:1643 (set (reg/f:DI 1179)
        (plus:DI (reg:DI 1178)
            (reg/f:DI 274 [ ivtmp.314 ]))) 160 {*pa.md:4941} (expr_list:REG_DEAD
 (reg:DI 1178)
        (nil)))

(insn 1209 1208 1210 110 ../../gcc/gcc/gimple.h:1643 (set (reg/f:DI 337 [ D.3525
9 ])
        (mem/f:DI (reg/f:DI 1179) [6 S8 A64])) 120 {*pa.md:4101} (expr_list:REG_
DEAD (reg/f:DI 1179)
        (nil)))

So, eventually, we end up with:

(insn 1209 8953 8954 ../../gcc/gcc/gimple.h:1643 (set (reg/f:DI 25 %r25 [orig:33
7 D.35259 ] [337])
        (mem/f:DI (plus:DI (reg:DI 28 %r28 [1178])
                (reg/f:DI 11 %r11 [orig:274 ivtmp.314 ] [274])) [6 S8 A64])) 120
 {*pa.md:4101} (expr_list:REG_DEAD (reg:DI 28 %r28 [1178])
        (nil)))

In expand, we had the following define for ivtmp.314:

dump_gimple_stmt (struct pretty_printer * buffer, union gimple_statement_d * gs,
 int spc, int flags)
{
  long unsigned int ivtmp.314;
Comment 9 dave 2010-06-15 13:15:15 UTC
Subject: Re:  [4.5/4.6 Regression] FAIL:
	gcc.dg/tree-ssa/20031015-1.c (internal compiler error)

Attached .i.

Dave
Comment 10 dave 2010-06-15 13:15:15 UTC
Created attachment 20915 [details]
gimple-pretty-print.i.gz
Comment 11 dave 2010-06-15 13:15:15 UTC
Created attachment 20916 [details]
xxx.sh
Comment 12 John David Anglin 2010-06-16 01:01:42 UTC
The REG_POINTER flag for reg:DI 274 is copied from reg:DI 2374 in pa.c.
The flag for reg:DI 2374 is in turn copied from reg:DI 2349 in pa.c.
The flag for reg:DI 2349 is set here:

(gdb) p debug_rtx (reg)                             
(reg:DI 2349 [ D.35290 ])
$68 = void
(gdb) bt                                            
#0  mark_reg_pointer (reg=0x800003fffd4c0420, align=64)
    at ../../gcc/gcc/emit-rtl.c:1118
#1  0x4000000001166d94 in set_reg_attrs_from_value (reg=0x800003fffd4c0420, 
    x=0x40fd976c40) at ../../gcc/gcc/emit-rtl.c:992
#2  0x4000000001166e14 in gen_reg_rtx_and_attrs (x=0x800003fffd976c40)
    at ../../gcc/gcc/emit-rtl.c:1003
#3  0x400000000195a8bc in move_invariant_reg (loop=0x800003fffdff18f0, 
    invno=64) at ../../gcc/gcc/loop-invariant.c:1416
#4  0x400000000195ad40 in move_invariants (loop=0x800003fffd4c0420)
    at ../../gcc/gcc/loop-invariant.c:1489
#5  0x400000000195ad40 in move_invariants (loop=0x800003fffd4c0420)
    at ../../gcc/gcc/loop-invariant.c:1489
#6  0x400000000195b2bc in move_single_loop_invariants (
    loop=0x800003fffced9ab0) at ../../gcc/gcc/loop-invariant.c:1558
#7  0x400000000195cdc8 in move_loop_invariants ()
    at ../../gcc/gcc/loop-invariant.c:1905
#8  0x40000000019302f8 in rtl_move_loop_invariants ()
    at ../../gcc/gcc/loop-init.c:254
#9  0x4000000001b86534 in execute_one_pass (pass=0x800003fffdff18f0)
    at ../../gcc/gcc/passes.c:1568
#10 0x4000000001b86964 in execute_pass_list (pass=0x800003fffd4c0420)
    at ../../gcc/gcc/passes.c:1623
#11 0x4000000001b869a8 in execute_pass_list (pass=0x800003fffd4c0420)
    at ../../gcc/gcc/passes.c:1624
#12 0x4000000001b869a8 in execute_pass_list (pass=0x800003fffd4c0420)
    at ../../gcc/gcc/passes.c:1624
#13 0x40000000027a78b8 in tree_rest_of_compilation (fndecl=0x800003fffdff18f0)
    at ../../gcc/gcc/tree-optimize.c:413
... 
Comment 13 John David Anglin 2010-06-16 01:27:59 UTC
The flag for reg:DI 2349 is copied from:

Breakpoint 7, set_reg_attrs_from_value (reg=0x800003fffd4c0420, 
    x=0x800003fffd976c40) at ../../gcc/gcc/emit-rtl.c:975
975       if (HARD_REGISTER_P (reg))
(gdb) p debug_rtx (reg)                                  
(reg:DI 2349)
$69 = void
(gdb) p debug_rtx (x)  
(reg/f:DI 356 [ D.35290 ])

The flag in reg/f:DI 356 is set here:

Breakpoint 6, mark_reg_pointer (reg=0x800003fffd976c40, align=64)
    at ../../gcc/gcc/emit-rtl.c:1118
1118      if (! REG_POINTER (reg))
(gdb) p debug_rtx (reg)                             
(reg:DI 356 [ D.35290 ])
$71 = void
(gdb) bt
#0  mark_reg_pointer (reg=0x800003fffd976c40, align=64)
    at ../../gcc/gcc/emit-rtl.c:1118
#1  0x4000000000dd6c54 in expand_one_register_var (var=0x800003fffdff1790)
    at ../../gcc/gcc/cfgexpand.c:847
#2  0x4000000000dd7574 in expand_one_var (var=0x800003fffd976c40, 
    toplevel=0 '\0', really_expand=128 '\200')
    at ../../gcc/gcc/cfgexpand.c:978
#3  0x4000000000dd8ecc in expand_used_vars ()
    at ../../gcc/gcc/cfgexpand.c:1310
#4  0x4000000000de6118 in gimple_expand_cfg ()
    at ../../gcc/gcc/cfgexpand.c:3779
#5  0x4000000001b86534 in execute_one_pass (pass=0x800003fffdff1790)
    at ../../gcc/gcc/passes.c:1568

(gdb) p debug_tree (var)
 <VEC(rtx,gc) 800003fffdff1790
    type <var_decl 800003fffcf8ce60 D.35290
        type <pointer_type 800003fffdd8ad20 tree type <union_type 800003fffdd8abd0 tree_node>
            sizes-gimplified asm_written public unsigned DI
            size <integer_cst 800003fffdec7758 constant 64>
            unit size <integer_cst 800003fffdec7780 constant 8>
            align 64 symtab -2147482625 alias set -1 canonical type 800003fffdd8ac78
            pointer_to_this <pointer_type 800003fffde01888>>
        used unsigned ignored DI file ../../gcc/gcc/gimple-pretty-print.c line 1498 col 1 size <integer_cst 800003fffdec7758 64> unit size <integer_cst 800003fffdec7780 8>
        align 64 context <function_decl 800003fffd691600 dump_gimple_stmt> abstract_origin <result_decl 800003fffd1b8a00 D.21084>
        (reg:DI 356 [ D.35290 ])>
    asm_written used nothrow public private protected static deprecated visited tree_0 tree_1 tree_2 tree_3 tree_4 tree_6>
Comment 14 John David Anglin 2010-06-16 02:44:25 UTC
I think the setting of reg:DI 2374 from reg:DI 2349 is incorrect.  Testing
fix.
Comment 15 John David Anglin 2010-06-18 00:24:10 UTC
Subject: Bug 43740

Author: danglin
Date: Fri Jun 18 00:23:51 2010
New Revision: 160955

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160955
Log:
	PR target/43740
	config/pa/pa.c (emit_move_sequence): Don't infer REG_POINTER flag for
	SET source operand from SET destination operand.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/pa/pa.c

Comment 16 John David Anglin 2010-06-18 00:26:43 UTC
Subject: Bug 43740

Author: danglin
Date: Fri Jun 18 00:26:33 2010
New Revision: 160956

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160956
Log:
	PR target/43740
	config/pa/pa.c (emit_move_sequence): Don't infer REG_POINTER flag for
	SET source operand from SET destination operand.


Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/config/pa/pa.c

Comment 17 John David Anglin 2010-06-18 00:29:42 UTC
Subject: Bug 43740

Author: danglin
Date: Fri Jun 18 00:29:30 2010
New Revision: 160957

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160957
Log:
	PR target/43740
	config/pa/pa.c (emit_move_sequence): Don't infer REG_POINTER flag for
	SET source operand from SET destination operand.


Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/config/pa/pa.c

Comment 18 John David Anglin 2010-06-18 00:32:09 UTC
Subject: Bug 43740

Author: danglin
Date: Fri Jun 18 00:31:53 2010
New Revision: 160958

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160958
Log:
	PR target/43740
	config/pa/pa.c (emit_move_sequence): Don't infer REG_POINTER flag for
	SET source operand from SET destination operand.


Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/config/pa/pa.c

Comment 19 John David Anglin 2010-06-18 00:32:41 UTC
Fixed.