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]

PATCH - Fix an ICE compiling for ppc64



Attached patch fixes an ICE compiling the test case with: -m64 -O1 -static. -m64 is Apple's ppc64 ABI option. Problem arises after 'combine' phase combines a series of true-dependent rtl insns into a single compare insn involving an integer constant. However, constant in this pattern does not meet the constraint laid down in rs6000.md pattern for integer constants. Reload then attempts to move this constant into a register via memory. Generated pattern to do the 'move' causes an invalid insn. Patch fixes this problem by introducing a new 'predicate' which enforces what the constraints enforce. This prevents 'combine' to combine into a pattern which is unsuitable and requires a memory load in 'reload'. Patch has been tested with Dejagnu test suite and -m64.


OK for mainline?

- fariborz

1) Pattern that 'combine' puts out:

(insn 41 40 42 1 (parallel [
            (set (reg:CC 68 cr0 [141])
                (compare:CC (eq:DI (reg:DI 0 r0 [133])
                        (const_int 549755813921 [0x8000000021]))
                    (const_int 0 [0x0])))
            (set (reg/v:DI 10 r10 [orig:120 negate_range ] [120])
                (eq:DI (reg:DI 0 r0 [133])
                    (const_int 549755813921 [0x8000000021])))
            (clobber (scratch:DI))
        ]) 396 {*rs6000.md:11887} (insn_list:REG_DEP_TRUE 32 (nil))
    (expr_list:REG_UNUSED (scratch:DI)
        (expr_list:REG_UNUSED (scratch:DI)
            (expr_list:REG_DEAD (reg:DI 0 r0 [133])
                (nil)))))

2) Behavior without this patch:

% gcc -c -m64 -O1 -static bad.c
bad.c: In function 'match':
bad.c:28: error: unrecognizable insn:
(insn 136 135 41 1 (set (reg:DI 2 r2)
(mem/u/i:DI (symbol_ref/u:DI ("*LC1") [flags 0x2]) [0 S8 A64])) -1 (nil)
(nil))
bad.c:28: internal compiler error: in extract_insn, at recog.c:2033
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.


ChangeLog:

2005-06-03 Fariborz Jahanian <fjahanian@apple.com>
* rs6000/predicates.md (reg_or_cshort_operand): New.
* rs6000/rs6000.md : Use reg_or_cshort_operand for ppc64 compares.


Attachment: fsf-patch-3869444.txt
Description: Text document


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