On Mon, 18 Feb 2019 at 05:12, Jordan Justen <jordan.l.jus...@intel.com> wrote:
>

This needs an explanation why optimization needs to be disabled.

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com>
> Cc: Laszlo Ersek <ler...@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheu...@linaro.org>
> Cc: Anthony Perard <anthony.per...@citrix.com>
> Cc: Julien Grall <julien.gr...@linaro.org>
> ---
>  OvmfPkg/Sec/SecMain.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c
> index 46ac739862..86c22a2ac9 100644
> --- a/OvmfPkg/Sec/SecMain.c
> +++ b/OvmfPkg/Sec/SecMain.c
> @@ -873,6 +873,13 @@ SecStartupPhase2(
>    CpuDeadLoop ();
>  }
>
> +#ifdef __GNUC__
> +#pragma GCC push_options
> +#pragma GCC optimize ("O0")
> +#else
> +#pragma optimize ("", off)
> +#endif
> +
>  EFI_STATUS
>  EFIAPI
>  TemporaryRamMigration (
> @@ -946,3 +953,8 @@ TemporaryRamMigration (
>    return EFI_SUCCESS;
>  }
>
> +#ifdef __GNUC__
> +#pragma GCC pop_options
> +#else
> +#pragma optimize ("", on)
> +#endif

I can't tell from the context if this is the end of the file, but if
it is not, aren't you turning on optimization here for non-GCC even if
it was not enabled on the command line to begin with?
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to