This is the mail archive of the gcc@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]

Stage1 compiler miscompiles Ada on ia64


The stage1 compiler miscompiles the ada compiler on ia64 with -O2.  The
symptoms are:

a-colire.adb:75:23: warning: loop range is null, loop will not execute
a-colire.adb:82:26: warning: loop range is null, loop will not execute
a-colire.adb:106:24: warning: loop range is null, loop will not execute
a-colire.adb:114:26: warning: loop range is null, loop will not execute

One of the miscompiled functions is Checks.Determine_Range, the damage
happens during flow2.  The epilogue is clobbering register r9 which is
also used to return Hi, so that Sem_Ch5.Analyze_Iteration_Scheme is
receiving garbage.  Here are the relevant parts of checks.adb.23.flow2:


(insn 3619 3618 2549 (set (reg:DI 9 r9)
        (mem:DI (reg:DI 18 r18) [67 S8 A64])) 6 {*movdi_internal} (insn_list 3617 (nil))
    (expr_list:REG_DEAD (reg:DI 18 r18)
        (nil)))

(insn 2549 3619 3701 (use (reg/i:TI 8 r8)) -1 (insn_list 3618 (nil))
    (expr_list:REG_DEAD (reg:DI 9 r9)
        (nil)))

(note 3701 2549 3704 NOTE_INSN_EPILOGUE_BEG)
[...]
(insn 3730 3728 3732 (set (reg:DI 9 r9)
        (mem:DI (post_modify:DI (reg:DI 28 r28)
                (plus:DI (reg:DI 28 r28)
                    (const_int 16 [0x10]))) [68 S8 A64])) -1 (insn_list 3726 (nil))
    (expr_list:REG_INC (reg:DI 28 r28)
        (nil)))

(insn 3732 3730 3734 (set (reg:DI 320 b0)
        (reg:DI 9 r9)) -1 (insn_list 3730 (nil))
    (nil))

The basic problem seems to be that insn 2549 marks register r9 as dead.

Andreas.

-- 
Andreas Schwab                                  "And now for something
Andreas.Schwab@suse.de				completely different."
SuSE Labs, SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5


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