On 4/29/20 10:13 AM, Richard Sandiford wrote:
> If this is a bug we need to fix for GCC 10 then how about this:
I do think this is important to fix. Mike Meissner just switched our
-mcpu=future code to enable -mpcrel by default in GCC10, so we're going
to see a lot more of these types of addresses than before.
> (1) change the MEM case to something like:
>
> {
> bool addr_changed = false;
> rtx addr = cse_process_notes (XEXP (x, 0), x, &addr_changed);
> if (addr_changed && validate_change (x, &XEXP (x, 0), addr, 0))
> *changed = true;
> return x;
> }
>
> which makes it safe to do the validation only at the top level
> of the MEM.
>
> (2) make the:
>
> for (i = 0; i < GET_RTX_LENGTH (code); i++)
> if (fmt[i] == 'e')
>
> loop assign directly to XEXP (x, i) if the new rtx is different,
> instead of using validate_change. This ensures that temporarily
> invalid rtl doesn't get verified.
>
> (passing a null object to validate_change would have the same effect,
> but that feels a bit hacky)
>
> (3) use the simplify_binary_operator thing above, since that at least
> should be safe, even if it potentially leaves similar bugs unfixed
> for other operators.
>
> Sorry for the runaround :-(
No problem. I appreciate the feedback and I agree we want to get this right.
I'll implement the above and report back. Thanks!
Peter