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: [RFC, PATCH ] [DATAFLOW] Validating an address in auto-inc-dec


I talked to Ian Taylor and David Edelsohn about this.  
No one can see the reason for this patch assuming that you have a
properly written port.

Immediately after the point where you would like to insert the the
memory_address_p there is a call to validate_change.  If your port is
written correctly, that call should see the mem reference in the new
part of the insn and call memory_address_p on it.  This is what
validate_change does for a living.

Kenny

> Hi,
> I am working on a private port, wherein the constant addition /
> subtraction in a post_modify  _must_  be less than a certain value.
> For such a check I have defined GO_IF_LEGITIMATE_ADDRESS
> appropriately. The problem is that attempt_change in auto-inc-dec
> doesnt check if the new address is a valid memory address or not
> resulting in an ICE in a later pass.
> 
> Therefore I wrote this patch, where in before replacing a memory
> address and its modification by a constant by a post_modify, I first
> check if the new address expression is going to be a valid expression.
> 
> Thanks,
> Pranav
> 
> ChangeLog:
>  * auto-inc-dec.c (attempt_change): Check if new_addr_pat is a
>         valid memory address.


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