This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix ICE with -fno-sso-struct=none (PR driver/78957)


On Mon, Jan 2, 2017 at 8:27 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> Enum options should not allow negative form, otherwise the option handling
> ICEs on it.  -fsso-struct= allows only big-endian or little-endian,
> -fno-sso-struct=big-endian or -fno-sso-struct=whatever makes no sense.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok, but maybe .opt processing can add RejectNegative on its own for
Enum switches then?  For the vectorizer we have (for backward compatibility):

fvect-cost-model
Common RejectNegative Alias(fvect-cost-model=,dynamic)
Enables the dynamic vectorizer cost model.  Preserved for backward
compatibility.

fno-vect-cost-model
Common RejectNegative Alias(fvect-cost-model=,unlimited)
Enables the unlimited vectorizer cost model.  Preserved for backward
compatibility.


Richard.

> 2017-01-02  Jakub Jelinek  <jakub@redhat.com>
>
>         PR driver/78957
>         * c.opt (fsso-struct=): Add RejectNegative.
>
>         * gcc.dg/pr78957.c: New test.
>
> --- gcc/c-family/c.opt.jj       2016-12-29 13:56:36.000000000 +0100
> +++ gcc/c-family/c.opt  2017-01-01 12:10:16.744757723 +0100
> @@ -1626,7 +1626,7 @@ fsquangle
>  C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
>
>  fsso-struct=
> -C ObjC Joined Enum(sso_struct) Var(default_sso) Init(SSO_NATIVE)
> +C ObjC Joined RejectNegative Enum(sso_struct) Var(default_sso) Init(SSO_NATIVE)
>  -fsso-struct=[big-endian|little-endian]        Set the default scalar storage order.
>
>  Enum
> --- gcc/testsuite/gcc.dg/pr78957.c.jj   2017-01-01 12:02:41.859809492 +0100
> +++ gcc/testsuite/gcc.dg/pr78957.c      2017-01-01 12:06:05.951094270 +0100
> @@ -0,0 +1,6 @@
> +/* PR driver/78957 */
> +/* { dg-do compile } */
> +/* { dg-options "-fno-sso-struct=none" } */
> +/* { dg-error "unrecognized command line option" "" { target *-*-* } 0 } */
> +
> +int i;
>
>         Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]