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]

Re: regclass/jump problems


  In message <E119noG-0000WE-00@fountain.nexus.co.uk>you write:
  > The attached testcase (from Rod Stewart) makes gcc blow up in 
  > jump_optimize_1 when compiling with -O2 on an arm-linux target.  The crash 
  > occurs at about line 800, in the test:
  > 
[ ... ]

  > At this point, temp5 refers to a register which is off the end of the 
  > reg_n_info varray.  From what I can tell, this is because 
  > duplicate_loop_exit_test has created new regs since regscan was last run.  
  > The patch below just arranges to have it call reg_scan_update after
  > potentially generating new registers; is that the right thing to do?
I think you're on the right track, but missing a couple details.

First we only call duplicate_loop_exit_test when after_regscan is true, so
there's no need to pass that value into duplicate_loop_exit_test and test
it before calling reg_scan_update.

Second, it seems to me that you need to call reg_scan_update after you
have copied the insns and the bounds should be the first copied insn and
the last copied insn.  Otherwise all you've done is hide the bug -- ie you'll
extend the virtual arrays, but since the new registers are not in the rtl
you're scanning all the values will be zero, which largely defeats the purpose
of calling reg_scan_update in the first place.

jeff


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