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]

Re: Prevent combine_instructions() from following non-existant LOG_LINKS



nickc@cygnus.com said:
>   I ran into a problem with combine_instructions() when RTL checking
>   is enabled.  Sometimes it can try to combine an insn which has been
>   deleted and the RTL checking code compainins about an attempt to
>   access the LOG_LINKS of a NOTE which is not supposed to have such a
>   field.  (It does have one, because it once was an insn, but the RTL
>   checking code does not know this).  The patch below fixes this small
>   problem by tetsing to see if the insn is a NOTE before LOG_LINKS is
>   called.
>   OK to apply this patch ? 

I posted about this last year with some additional analysis as to why it 
was happening for me (see "Problem with auto-inc code (ARM)" from early 
November).  I'm afraid I haven't had time to follow up on it since then.

In essence, the problem is that the flow graph is incorrect in that we 
have deleted an insn that was being pointed to with a log_link (flow can 
do this when making pre/post inc/dec insns, which it does after building 
the links).

Before the patch goes in, I believe the following question needs answering:

"How accurate can combine expect the flow data to be?"  

(I'm not necessarily talking about completeness, just that the information 
in there is correct if it is there at all.)

If the answer to the above question is "fully", then your patch is wrong, 
and we should probably fix combine to call abort if it detects an anomaly.

If the answer is that errors like the above are acceptable, then I guess 
your patch is the right one.

My personal opinion is that combine should abort in this case, and that 
flow should be fixed so as not to create bogus links.

R.


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