This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IRA costs tweaks, PR 56069


On 04/27/2016 06:02 AM, Jeff Law wrote:
AFAICT the sra-1.c expects to see the incremented value and I'm at a
loss to understand what's really going on here.  Can you give more details?

Yeah, maybe my first impression wasn't very accurate.

When I try to run gdb manually, it just crashes:

(gdb) show version
GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
(gdb) b 43
Breakpoint 1 at 0x40059b: file sra-1.c, line 43.
(gdb) run
Starting program: /local/src/egcs/bscommit/gcc/a.out

Breakpoint 1, f3 (k=<optimized out>) at sra-1.c:43
43	  bar (a.j);		/* { dg-final { gdb-test 43 "a.j" "14" } } */
(gdb) p a.j
Segmentation fault (core dumped)

Here's rtl from the final dump (reg notes and insn codes etc. removed where it seemed to help readability):

(note 49 21 39 2 (var_location a$i (const_int 4 [0x4])) NOTE_INSN_VAR_LOCATION)
(insn:TI 39 49 2 2 (set (reg:HI 0 ax [orig:97 a$i ] [97])
        (const_int 4 [0x4])) sra-1.c:40

(insn 2 39 50 2 (set (reg/v:SI 1 dx [orig:96 k ] [96])
        (reg:SI 5 di [ k ])) sra-1.c:38

(note 50 2 12 2 (var_location a$j (plus:HI (reg:HI 1 dx [orig:96 k ] [96])
    (const_int 6 [0x6]))) NOTE_INSN_VAR_LOCATION)

(insn:TI 12 50 51 2 (parallel [
            (set (reg:HI 0 ax [orig:97 a$i ] [97])
                (asm_operands:HI ("") ("=r") 0 [
                        (reg:HI 0 ax [orig:97 a$i ] [97])
                    ]
                     [
                        (asm_input:HI ("0") sra-1.c:40)
                    ]
                     [] sra-1.c:40))
            (clobber (reg:CCFP 18 fpsr))
            (clobber (reg:CC 17 flags))
        ]) sra-1.c:40 -1

(note 51 12 52 2 (var_location a$i (reg:HI 0 ax [orig:97 a$i ] [97])) NOTE_INSN_VAR_LOCATION)
(note 52 51 15 2 (var_location a$j (plus:HI (reg:HI 1 dx [orig:96 k ] [96])
    (const_int 7 [0x7]))) NOTE_INSN_VAR_LOCATION)
(insn:TI 15 52 16 2 (set (reg:SI 2 cx [orig:92 _10 ] [92])
        (sign_extend:SI (reg:HI 0 ax [orig:97 a$i ] [97]))) sra-1.c:42

(insn:TI 16 15 53 2 (set (reg:SI 5 di)
        (reg:SI 2 cx [orig:92 _10 ] [92])) sra-1.c:42 86

(note 53 16 17 2 (var_location k (reg/v:SI 1 dx [orig:96 k ] [96])) NOTE_INSN_VAR_LOCATION)

(call_insn:TI 17 53 54 2 (call (mem:QI (symbol_ref:DI ("bar")))

(note 54 17 41 2 (expr_list:REG_DEP_TRUE (concat:SI (reg:SI 5 di)
        (reg:SI 2 cx [orig:92 _10 ] [92]))
    (nil)) NOTE_INSN_CALL_ARG_LOCATION)
(insn:TI 41 54 55 2 (parallel [
            (set (reg:SI 1 dx [101])
                (plus:SI (reg:SI 1 dx [orig:96 k ] [96])
                    (const_int 7 [0x7])))
            (clobber (reg:CC 17 flags))
        ]) sra-1.c:41 218 {*addsi_1}
(note 55 41 56 2 (var_location k (plus:SI (reg:SI 1 dx [101])
    (const_int -7 [0xfffffffffffffff9]))) NOTE_INSN_VAR_LOCATION)
(note 56 55 42 2 (var_location a$j (reg:HI 1 dx [101])) NOTE_INSN_VAR_LOCATION)
(insn:TI 42 56 57 2 (parallel [
            (set (reg:SI 1 dx [103])
                (ashift:SI (reg:SI 1 dx [101])
                    (const_int 4 [0x4])))
            (clobber (reg:CC 17 flags))
        ]) sra-1.c:41

(note 57 42 58 2 (var_location k (entry_value:SI (reg:SI 5 di [ k ]))) NOTE_INSN_VAR_LOCATION) (note 58 57 23 2 (var_location a$j (plus:HI (subreg:HI (entry_value:SI (reg:SI 5 di [ k ])) 0)
    (const_int 7 [0x7]))) NOTE_INSN_VAR_LOCATION)

(insn:TI 23 58 24 2 (parallel [
            (set (reg:HI 1 dx [104])
                (ashiftrt:HI (reg:HI 1 dx [103])
                    (const_int 4 [0x4])))
            (clobber (reg:CC 17 flags))
        ]) sra-1.c:41
(insn:TI 24 23 59 2 (set (reg:SI 0 ax [orig:93 _12 ] [93])
        (sign_extend:SI (reg:HI 1 dx [104]))) sra-1.c:43

(note 59 24 25 2 (var_location a$i (reg:HI 2 cx [orig:92 _10 ] [92])) NOTE_INSN_VAR_LOCATION)
(insn:TI 25 59 26 2 (set (reg:SI 5 di)
        (reg:SI 0 ax [orig:93 _12 ] [93])) sra-1.c:43 86 {*movsi_internal}
     (nil))

(call_insn:TI 26 25 60 2 (call (mem:QI (symbol_ref:DI ("bar")))


I don't really understand the var-tracking stuff too well, so no idea where to go from here. I suppose I'm withdrawing my patch.


Bernd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]