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] |
Hi! As described in the PR, DSE2 removes a needed store into a spill slot because it thinks it doesn't overlap with the use. Before reload we have: (set (reg:QI 5621) ...) ... (set ... (xor:SI (subreg:SI (reg:QI 5621) 0) ...)) (and &= 255 later on, so the higher bits are ignored). As the register pressure is extremely high, pseudo 5621 is spilled: (set (reg:SI 14 %r14) (const_int 4096 [0x1000])) (set (mem/c:QI (plus:SI (plus:SI (reg/f:SI 15 %r15) (reg:SI 14 %r14)) (const_int 519 [0x207])) [7 %sfp+-137 S1 A8]) ...) ... (set (reg:SI 4 %r4) (const_int 4096 [0x1000])) (set ... (xor:SI ... (mem/c:SI (plus:SI (plus:SI (reg/f:SI 15 %r15) (reg:SI 4 %r4)) (const_int 516 [0x204])) [7 %sfp+-140 S1 A8]))) The spill slot for QImode had MEM_ATTRS [7 %sfp+-137 S1 A8] and when find_reloads_subreg_address widened that to SImode, it didn't adjust MEM_SIZE, so nonoverlapping_memrefs_p during DSE2 thinks that QImode [7 %sfp+-137 S1 A8] and SImode [7 %sfp+-140 S1 A8] can't overlap (it doesn't consider MEM's mode when MEM_SIZE is set). Fixed by adjusting also MEM_SIZE. Attached are two patches, the first attempt where it adjusts MEM_SIZE only when MEM_OFFSET is set has been bootstrapped/regtested on x86_64-linux/trunk and {x86_64,i686,powerpc,powerpc64,s390,s390x}-linux on 4.4 branch. I did it because I wasn't sure what does MEM_SIZE mean when MEM_OFFSET isn't set, if it isn't the size of the whole decl. But after reading adjust_address_1 etc., I believe it should be for non-BLKmode MEMs always the size of the mode, so probably the second patch (which fixes the testcase too) should be used instead. The MEM_ATTRS check is there to avoid creating MEM_ATTRS if it has none (in that case MEM_SIZE gives GET_MODE_SIZE of the mode, and we would needlessly create MEM_ATTRS). Ok for trunk/4.4? Jakub
Attachment:
Y498
Description: Text document
Attachment:
Y498a
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |