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: [patch 3.3/3.4/3.5] Fix PR bootstrap/14671


> This suggests that Zdenek's patch on March 18 results in the instructions
> which use this RTX being removed from the instruction chain but for
> some reason we are still using reg_known_value[294].  I'll try to look
> into this.

This appears to be what's happening.  After gcse, we have:

(insn 529 527 530 43 ../../gcc/gcc/caller-save.c:713 (set (reg/v/f:DI 294 [ to_save ])
        (plus:DI (reg/f:DI 3 %r3)
	    (const_int 272 [0x110]))) 158 {*pa.md:4807} (nil)
   (nil))

Loop changes this to:

(insn 1435 1434 1437 (set (reg/f:DI 576)
        (plus:DI (reg/f:DI 3 %r3)
	    (const_int 272 [0x110]))) -1 (nil)
   (nil))

...

(insn 1436 511 1438 (set (reg/f:DI 491)
        (reg/f:DI 576)) -1 (nil)
    (nil))

...

(insn 1298 1024 533 (set (reg/v/f:DI 294 [ to_save ])
        (reg/f:DI 491)) -1 (nil)
    (nil))

So, we still have reg/v/f:DI 294 but the rtx is reg_known_value[294]
has been orphaned.  ggc_collect poisons the rtx.  Then, the next time
scan_loop is called we have a problem with the value for reg 294.

Maybe my patch is the best solution.  However, I think Zdenek should
look at this.  The problem may have been introduced with this change:

2004-03-18  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>

        * doloop.c: Removed.
	* loop-doloop.c: New file.
	* Makefile.in (doloop.o): Remove.
	(loop-doloop.o): New.
	* cfgloop.h (get_loop_level, doloop_optimize_loops): Declare.
	* cfgloopanal.c (get_loop_level): New function.
	* loop-iv.c (iv_number_of_iterations): Handle case when loop
	is leaved immediatelly.
	* loop.c (strength_reduce): Do not call doloop optimization.
	* loop.h (LOOP_BCT): Removed.
	* passes.c (rest_of_handle_loop_optimize): Do not use LOOP_BCT.
	(rest_of_handle_loop2): Call doloop_optimize_loops.
	(rest_of_compilation): Test for optimizations moved to
	rest_of_handle_loop2.

However, if that's not the case, then the problem applies to 3.3
and 3.4 as well.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)


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