This is the mail archive of the gcc-bugs@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: optimization/6713: Regression wrt 3.0.4: g++ -O2 leads to seg fault at run time


http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6713

FYI: the problem also goes away when compiling w/ -O2 -fno-strength-reduce.
I'm not sure how it's supposed to work, but strength_reduce() in loop.c
eliminates reg 60 but leaves a REG_EQUAL note referring to it within the loop.
I think this REG_EQUAL note is cause of the problem...  If I eliminate it,
the problem goes away.  BTW, changing ++i to i++ in the for loop avoids the
problem since the REG_EQUAL note is not emitted in that case.

Any thoughts on how to fix this?  I'm not familiar enough with the loop
optimizer to produce a proper patch.

- Glen Nakamura


[snip]
giv at 482 reduced to (reg 135)
giv at 480 reduced to (reg 135)
biv 60 was eliminated.
Reg 60: biv eliminated
[snip]
(note 351 591 492 NOTE_INSN_LOOP_BEG)
[snip]
(note 529 474 482 [bb 6] NOTE_INSN_BASIC_BLOCK)

(insn 482 529 588 (set (reg/s/f:SI 111)
        (reg/f:SI 135)) -1 (nil)
    (expr_list:REG_EQUAL (plus:SI (reg/v:SI 60)   <<< PROBLEM NOTE???
            (const_int 1 [0x1]))
        (nil)))

(insn 588 482 489 (set (reg/s/f:SI 111)
        (reg/f:SI 135)) -1 (nil)
    (nil))

(note 489 588 490 0x40660980 NOTE_INSN_BLOCK_END)
[snip]
(note 497 408 499 NOTE_INSN_LOOP_END)
[snip]


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