On 14/07/2022 08:53, Jan Beulich wrote: > While a number of issues we previously had with pre-release gcc12 were > fixed in the final release, we continue to have one issue (with multiple > instances) when doing release builds (i.e. at higher optimization > levels): The compiler takes issue with subtracting (always 1 in our > case) from artifical labels (expressed as array) marking the end of > certain regions. This isn't an unreasonable position to take. Simply > hide the "array-ness" by casting to an integer type. To keep things > looking consistently, apply the same cast also on the respective > expressions dealing with the starting addresses. (Note how > efi_arch_memory_setup()'s l2_table_offset() invocations avoid a similar > issue by already having the necessary casts.) In is_xen_fixed_mfn() > further switch from __pa() to virt_to_maddr() to better match the left > sides of the <= operators. > > Reported-by: Charles Arnold <[email protected]> > Signed-off-by: Jan Beulich <[email protected]> > --- > Initially I had considered introducing something like END_MINUS_1(), but > in the end I did consider this uglier than explicitly dealing with the > two instances we have.
Yeah, I prefer this form. Acked-by: Andrew Cooper <[email protected]>
