This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR/11368 clearer documentation on -falign-*
Matt Kraai wrote:-
> > case OPT_falign_loops:
> > case OPT_falign_loops_:
> > - align_loops = value;
> > + align_loops = !value;
> > break;
> >
> > case OPT_fargument_alias:
>
> Don't these do the wrong thing if the argument is greater than
> one?
>
> --
> Matt Kraai kraai@alumni.cmu.edu Debian GNU/Linux
Jim Wilson wrote:-
> As another already mentioned, you need to handle the both the cases with
> an argument and without one.
>
> -falign-functions, align_functions = 0
> -fno-align-functions, align_functions = 1
> -falign-functions=0, align_functions = 0
> -falign-functions=1, align_functions = 1
> -falign-functions=2, align_functions = 2
>
> You can invert the value only if there was no argument to the option.
I wondered what made me do it the way I did it originally, now it's
clear. Does this look OK?
Neil.
* opts.c (common_handle_option): Correct handling of the
-falign- switches that do and don't take an argument.
Index: opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/opts.c,v
retrieving revision 1.23
diff -u -p -r1.23 opts.c
--- opts.c 6 Jul 2003 19:01:17 -0000 1.23
+++ opts.c 7 Jul 2003 05:05:07 -0000
@@ -782,23 +782,35 @@ common_handle_option (size_t scode, cons
break;
case OPT_falign_functions:
- case OPT_falign_functions_:
align_functions = !value;
break;
+ case OPT_falign_functions_:
+ align_functions = value;
+ break;
+
case OPT_falign_jumps:
- case OPT_falign_jumps_:
align_jumps = !value;
break;
+ case OPT_falign_jumps_:
+ align_jumps = value;
+ break;
+
case OPT_falign_labels:
- case OPT_falign_labels_:
align_labels = !value;
break;
+ case OPT_falign_labels_:
+ align_labels = value;
+ break;
+
case OPT_falign_loops:
- case OPT_falign_loops_:
align_loops = !value;
+ break;
+
+ case OPT_falign_loops_:
+ align_loops = value;
break;
case OPT_fargument_alias: