Patchwork Fix ICE with gfortran ... -L without argument (PR fortran/49623)

login
register
mail settings
Submitter Jakub Jelinek
Date July 4, 2011, 5:22 p.m.
Message ID <20110704172244.GS16443@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/103142/
State New
Headers show

Comments

Jakub Jelinek - July 4, 2011, 5:22 p.m.
Hi!

If -L doesn't have an argument, find_spec_file ICEs on it, as
the argument is NULL.  As suggested by Joseph, this disregards in
this loop all options which don't have the required argument.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk/4.6?

2011-07-04  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/49623
	* gfortranspec.c (lang_specific_driver): Ignore options with
	CL_ERR_MISSING_ARG errors.


	Jakub
Paul Richard Thomas - July 4, 2011, 7:13 p.m.
Dear Jakub,

Yes!  OK for trunk and, if you will, for 4.6.

Thanks

Paul

On Mon, Jul 4, 2011 at 7:22 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> If -L doesn't have an argument, find_spec_file ICEs on it, as
> the argument is NULL.  As suggested by Joseph, this disregards in
> this loop all options which don't have the required argument.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk/4.6?
>
> 2011-07-04  Jakub Jelinek  <jakub@redhat.com>
>
>        PR fortran/49623
>        * gfortranspec.c (lang_specific_driver): Ignore options with
>        CL_ERR_MISSING_ARG errors.
>
> --- gcc/fortran/gfortranspec.c.jj       2011-07-04 14:58:56.000000000 +0200
> +++ gcc/fortran/gfortranspec.c  2011-07-04 15:01:58.000000000 +0200
> @@ -255,6 +255,9 @@ lang_specific_driver (struct cl_decoded_
>
>   for (i = 1; i < argc; ++i)
>     {
> +      if (decoded_options[i].errors & CL_ERR_MISSING_ARG)
> +       continue;
> +
>       switch (decoded_options[i].opt_index)
>        {
>        case OPT_SPECIAL_input_file:
>
>        Jakub
>

Patch

--- gcc/fortran/gfortranspec.c.jj	2011-07-04 14:58:56.000000000 +0200
+++ gcc/fortran/gfortranspec.c	2011-07-04 15:01:58.000000000 +0200
@@ -255,6 +255,9 @@  lang_specific_driver (struct cl_decoded_
 
   for (i = 1; i < argc; ++i)
     {
+      if (decoded_options[i].errors & CL_ERR_MISSING_ARG)
+	continue;
+
       switch (decoded_options[i].opt_index)
 	{
 	case OPT_SPECIAL_input_file: