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] Fix CSE bogus RTL creation


On 06/15/2010 12:07 PM, Steven Bosscher wrote:
On Tue, Jun 15, 2010 at 11:35 AM, Paolo Bonzini<bonzini@gnu.org> wrote:
1. It means validate_change validates something that is not canonical RTL.

But that is not the task of validate_change. It would be done with a patch like the attached (which is not meant to be applied right away, but would do the same as Paul's in a better way).

That's one possibility. I was thinking, since it's only in a REG_NOTE, a change doesn't even have to be validated at all (AFAIU, anything goes in a note)

Even invalid addresses? (Genuine question; those are definitely ruled out by validate_change, and that part dates back to the initial import of GCC sources).


, so instead of validate_change the replacement should
perhaps be done with simplify_replace_rtx...?

Yes, the whole cse_process_notes function can become a single call to simplify_replace_fn_rtx (the replacement function being basically the REG case of cse_process_notes_1). Even better, simplify_replace_fn_rtx knows how to deal with SUBREGs, so this case would go away:


        /* We don't substitute VOIDmode constants into these rtx,
           since they would impede folding.  */
        if (GET_MODE (new_rtx) != VOIDmode)
          validate_change (object, &XEXP (x, 0), new_rtx, 0);

Besides possible problems due to invalid addresses (because simplify_replace_rtx uses replace_equiv_address_nv) I like this.

Paolo


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