summaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorkraai <kraai@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-29 00:37:54 +0000
committerkraai <kraai@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-29 00:37:54 +0000
commit47140d2890cbeec3b0f7e069039ca6ca1946b8b9 (patch)
treec7bfd8aba2f8ca93263b770a18023dfb54d9a4c1 /gcc/opts.c
parent8f9ac0474f47fc1e6b639f87b3345332bafc8822 (diff)
downloadgcc-47140d2890cbeec3b0f7e069039ca6ca1946b8b9.tar.gz
(gcc)
PR diagnostic/17594 * opts.c (find_opt): Require that the input match a switch exactly or that the switch take a joined option to be interpreted as a match for another language. (gcc/testsuite) * gcc.dg/funroll-loops-all.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91444 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 188ad29a8ad..e930c44c0fc 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -176,13 +176,13 @@ find_opt (const char *input, int lang_mask)
{
const struct cl_option *opt = &cl_options[mn];
- /* Is this switch a prefix of the input? */
- if (!strncmp (input, opt->opt_text + 1, opt->opt_len))
+ /* Is the input either an exact match or a prefix that takes a
+ joined argument? */
+ if (!strncmp (input, opt->opt_text + 1, opt->opt_len)
+ && (input[opt->opt_len] == '\0' || (opt->flags & CL_JOINED)))
{
- /* If language is OK, and the match is exact or the switch
- takes a joined argument, return it. */
- if ((opt->flags & lang_mask)
- && (input[opt->opt_len] == '\0' || (opt->flags & CL_JOINED)))
+ /* If language is OK, return it. */
+ if (opt->flags & lang_mask)
return mn;
/* If we haven't remembered a prior match, remember this