This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Enable the use of a resolution file
- From: Diego Novillo <dnovillo at google dot com>
- To: Rafael Espindola <espindola at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Cary Coutant <ccoutant at google dot com>
- Date: Thu, 12 Nov 2009 07:40:10 -0500
- Subject: Re: [patch] Enable the use of a resolution file
- References: <38a0d8450911100939w5dc23fbam13a4ea2c16ef5a37@mail.gmail.com>
On Tue, Nov 10, 2009 at 12:39, Rafael Espindola <espindola@google.com> wrote:
> lto/
> 2009-11-10 ÂRafael Avila de Espindola Â<espindola@google.com>
>
> Â Â Â Â* lang.opt (fresolution): Renamed from resolution.
> Â Â Â Â* lto-lang.c (lto_handle_option): Handle new option name.
> Â Â Â Â* lto.c (lto_resolution_read): Add more checks. Discard rest of line.
OK with one nit:
> @@ -303,9 +306,8 @@ lto_resolution_read (FILE *resolution, const char *file_name)
> break;
> }
> }
> - if (j >= lto_resolution_str_len)
> - internal_error ("tried to read past the end of the linker resolution "
> - "file");
> + if (j == lto_resolution_str_len)
> + internal_error ("Invalid resolution in the resolution file.");
Seems safer to keep the original '>=' test instead of '=='. The
loop now guarantees that '==' is sufficient, so this mostly
protects it from future code rearrangements.
Diego.