From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 186AF386100F for ; Tue, 13 Jul 2021 08:16:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 186AF386100F Received: by mail-ej1-x629.google.com with SMTP id o5so39998987ejy.7 for ; Tue, 13 Jul 2021 01:16:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=u0NkkkVefOn2WhdomCVdVf3fyt/lNEbT0QZqFhDk764=; b=Hbv3M8nMQ3KTP4sunMWbxp8kXN1wmYAeJ8+UYI3L7fK/G7dT/0SfulLyXQ+tHl044J 0Bp3OxoDPZfuDrVBlzQmHN4pLezRhf3v3OFepaSmDlmaIH7yb5i4h7kd26uf0ibWyzJX rmj5ELA6Zjzcl4VqQa7+ecdwznlGlPtO5FrabDiVOYDIR6xF0L40u6Uev4/bFm0L0wXW LqB88xf6GSaQSUA1ZyxfWYoiZwn/VQnIms3fg+bBANCbBVCfOkoQDPMnfLRHt5uOhPu2 v5/C/zoTGRwsBTxkiJNYwBVtVI1MO5qBFndIPG+gyuDn86ZykHuNlyPpe15NB/j52adt Dtvw== X-Gm-Message-State: AOAM5325qj+8a6RahnPDYKKMJ/cqh5b936d3xmNjncqCL0gnFHo1qTuU /grnXg4HmH9ysJk1NuZ/ZI/KTCifkbQX4kZSEqA= X-Google-Smtp-Source: ABdhPJxO9mao6Eyq8dhReaP3wl+MzHHZeQ7BOt6+dRz2eS2/OLUWh0eDhsMSvg3PgufiDEgB3R4V1CR+Hbf4s7D/+wQ= X-Received: by 2002:a17:906:f9c5:: with SMTP id lj5mr4261315ejb.482.1626164172174; Tue, 13 Jul 2021 01:16:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Tue, 13 Jul 2021 10:16:01 +0200 Message-ID: Subject: Re: fix typo in attr_fnspec::verify To: Alexandre Oliva Cc: GCC Patches , Jan Hubicka Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2021 08:16:14 -0000 On Tue, Jul 13, 2021 at 5:15 AM Alexandre Oliva wrote: > > > Odd-numbered indices describing argument access sizes in the fnspec > string can only hold 't' or a digit, as tested in the beginning of the > case. When checking that the size-supplying argument does not have > additional information associated with it, the test that excludes the > 't' possibility looks for it at the even position in the fnspec > string. Oops. > > This might yield false positives and negatives if a function has a > fnspec in which an argument uses a 't' access-size, and ('t' - '1') > happens to be the index of an argument described in an fnspec string. > Assuming ASCII encoding, it would take a function with at least 68 > arguments described in fnspec. Still, probably worth fixing. > > Regstrapped on x86_64-linux-gnu. I'm checking this in as obvious unless > there are objections within some 48 hours. oops - also worth backporting to affected branches. Richard. > > for gcc/ChangeLog > > * tree-ssa-alias.c (attr_fnspec::verify): Fix index in > non-'t'-sized arg check. > --- > gcc/tree-ssa-alias.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c > index 0421bfac99869..742a95a549e20 100644 > --- a/gcc/tree-ssa-alias.c > +++ b/gcc/tree-ssa-alias.c > @@ -3895,7 +3895,7 @@ attr_fnspec::verify () > && str[idx] != 'w' && str[idx] != 'W' > && str[idx] != 'o' && str[idx] != 'O') > err = true; > - if (str[idx] != 't' > + if (str[idx + 1] != 't' > /* Size specified is scalar, so it should be described > by ". " if specified at all. */ > && (arg_specified_p (str[idx + 1] - '1') > > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > Disinformation flourishes because many people care deeply about injustice > but very few check the facts. Ask me about