From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <> Received: from fx302.security-mail.net (mxout.security-mail.net [85.31.212.42]) by sourceware.org (Postfix) with ESMTPS id 9D0BA395ACD0 for ; Tue, 10 Aug 2021 13:22:55 +0000 (GMT) Authentication-Results: sourceware.org; dkim=permerror (bad message/signature format) Received: by fx302.security-mail.net (Postfix) id 132C03D3B08D; Tue, 10 Aug 2021 15:22:54 +0200 (CEST) Date: Tue, 10 Aug 2021 15:22:54 +0200 (CEST) From: MAILER-DAEMON (Mail Delivery System) Subject: Undelivered Mail Returned to Sender To: gcc-patches@gcc.gnu.org Auto-Submitted: auto-replied MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="C7D3E3D3B0BF.1628601774/fx302.security-mail.net" Content-Transfer-Encoding: 8bit Message-Id: <20210810132254.132C03D3B08D@fx302.security-mail.net> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, TXREP 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-Content-Filtered-By: Mailman/MimeDel 2.1.29 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, 10 Aug 2021 13:23:07 -0000 This is a MIME-encapsulated message. --C7D3E3D3B0BF.1628601774/fx302.security-mail.net Content-Description: Notification Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit This is the mail system at host fx302.security-mail.net. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to postmaster. If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system : host zimbra2.kalray.eu[195.135.97.26] said: 550 5.1.1 : Recipient address rejected: User unknown in virtual mailbox table (in reply to RCPT TO command) --C7D3E3D3B0BF.1628601774/fx302.security-mail.net Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; fx302.security-mail.net X-Postfix-Queue-ID: C7D3E3D3B0BF X-Postfix-Sender: rfc822; gcc-patches@gcc.gnu.org Arrival-Date: Tue, 10 Aug 2021 15:22:53 +0200 (CEST) Final-Recipient: rfc822; marc.poulhies@kalray.eu Original-Recipient: rfc822;marc.poulhies@kalray.eu Action: failed Status: 5.1.1 Remote-MTA: dns; zimbra2.kalray.eu Diagnostic-Code: smtp; 550 5.1.1 : Recipient address rejected: User unknown in virtual mailbox table --C7D3E3D3B0BF.1628601774/fx302.security-mail.net Content-Description: Undelivered Message Content-Type: message/rfc822 Content-Transfer-Encoding: 8bit Return-Path: Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) by fx302.security-mail.net (Postfix) with ESMTPS id 60C5F3D3B044 for ; Tue, 10 Aug 2021 15:22:52 +0200 (CEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 60A5C395ACCF for ; Tue, 10 Aug 2021 13:22:51 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 949FC395BC51 for ; Tue, 10 Aug 2021 13:21:45 +0000 (GMT) Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-531-IVPwOFkpPXq9uklgqxzX6A-1; Tue, 10 Aug 2021 09:21:44 -0400 Received: by mail-qk1-f197.google.com with SMTP id p123-20020a378d810000b02903ad5730c883so15204266qkd.22 for ; Tue, 10 Aug 2021 06:21:44 -0700 (PDT) Received: from ?IPv6:2607:fea8:a25f:c200:bc2e:f94a:b7a3:7cf9? ([2607:fea8:a25f:c200:bc2e:f94a:b7a3:7cf9]) by smtp.gmail.com with ESMTPSA id k8sm1929288qtp.14.2021.08.10.06.21.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Aug 2021 06:21:38 -0700 (PDT) X-Quarantine-ID: X-Virus-Scanned: E-securemail, by Secumail X-Spam-Status: No, score=-2.326 tagged_above=-1000 required=7.5 tests=[AB_ENVFROM_LONG_40=0.5, AB_IN_REPLY_TO_EXISTS=-1, AB_LONG_SUBJ_30=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-1, DKIM_VALID_AU=-0.1, FSL_RCVD_EX_5=0.01, FSL_RCVD_UT_5=0.01, HEAD_NEWS=-0.5, MISSING_MID=0.14, MM_ENVFROM_BOUNCE=1, NICE_REPLY_A=1, RCVD_IN_DNSWL_MED=-1.3, RDNS_DYNAMIC=0.363, S_FROM_GREY_MINUS_2=-2, S_KW_BODY_PROMOTION=0.45] autolearn=disabled Authentication-Results: fx302.security-mail.net (amavisd-new); dkim=pass (1024-bit key) header.d=gcc.gnu.org Secumail-id: <14e68.61127dac.234a0.0> DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60A5C395ACCF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1628601771; bh=i+xzQzwJ5/8xhlgDWq1iy6LTZUJwiaUHDIab7d4rMEQ=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=n6LYP1NbjDFf/LrUghFIrstJv4NLerAIaMEMPiRyVUy1/XZESVhOHqqsL6ZAtMBx2 ONoXgHyqorNVGuBSvaBpSh4AZqG3hB8ryDm1yL0p2u4jqhIArVMv2WlFCiycAZWQ59 +/C62jH7on94FT8C2xpKpW4CpzHFkEUKpZk6mdzE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 949FC395BC51 X-MC-Unique: IVPwOFkpPXq9uklgqxzX6A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=i+xzQzwJ5/8xhlgDWq1iy6LTZUJwiaUHDIab7d4rMEQ=; b=InBmh40DUxhOyFu7bIspOjs3epVXe00JNqabNwExWOxCMEYoC8j+S/kRexzEKIjaPz FQcNcKN5HhcitCMTwyQ2g2waEWRXmB0e7lbm3Yl0ZrLP+dsGzhEOZGwpd7lQOMnCK+um BC0jBqFnl00wSVeAn+h9B+SbTIwMXxxStdPy4pNxq33WuH3uEwOslxP6/BPH98q9GCKf LQHSNXAj7VGPOF0Ln+932oy58s75L/uOKPE6JKtGwISyvCjChWyrY98sgsrzTORdxNmx yo0rqPB9Im79i3JROUJ8a433t77hLtmYZlncziEi08gIARAEiUpb93giXTHA2lMqDb0v PsHQ== X-Gm-Message-State: AOAM531GQjTXCKawnQaExlQlGekbb/h8agBtiJ9nJaBxLEniI4Y7TZWa 4nowAYOAaUHox169XTDLcZOmhCLWKTrBMUlcT4m8gGJBTxLmLq6RCHqkpoeud0aw9oxqT17V2PT R1js9UFTA6E07T9JDdATcr7U4aN8ern77bat4i9hCBUb5CgmFont6oIwkLrHPqQS/8eN/8Q== X-Received: by 2002:a0c:aacd:: with SMTP id g13mr18026948qvb.20.1628601702174; Tue, 10 Aug 2021 06:21:42 -0700 (PDT), by 2002:a0c:aacd:: with SMTP id g13mr18026746qvb.20.1628601699402; Tue, 10 Aug 2021 06:21:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPr53q9u+BPsgEylRX+Hfwf4+UMS2GL3Vykv8OHvujqKZk52/fHE2vh4Q7e+xsvN9NsWJzBA== Subject: Re: [COMMITTED] PR tree-optimization/101741 - Ensure toupper and tolower follow the expected pattern. To: Richard Biener References: <49b8d18d-98fe-84de-6a00-34d08fc2cfc7@redhat.com> Message-ID: <448e095e-cce5-a29a-ce51-4053fda5e596@redhat.com> Date: Tue, 10 Aug 2021 09:21:36 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-ca 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: , From: Andrew MacLeod via Gcc-patches Reply-To: Andrew MacLeod Cc: gcc-patches Errors-To: gcc-patches-bounces+marc.poulhies=kalray.eu@gcc.gnu.org Sender: Gcc-patches X-ALTERMIMEV2_in: done Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 8/10/21 3:45 AM, Richard Biener wrote: > On Mon, Aug 9, 2021 at 10:31 PM Andrew MacLeod via Gcc-patches > wrote: >> The user has overridden the function name "toupper" . Its marked as a >> builtin function, presumably because it matches the name. In range >> folding, we were assuming the LHS and the parameter were compatible >> types... but they are not in this case.. >> >> I don't know if we should be marking such a thing as a builtin function, >> but regardless.. we shouldn't be trapping. If the type of the argument >> is not compatible with the LHS, then we'll simply assume nothing about >> the function. >> >> Bootstraps with no regression on x86_64-pc-linux-gnu. pushed. > I wonder why the gimple_call_combined_fn verification > using gimple_builtin_call_types_compatible_p isn't enough here? > Yes, it's matching is a bit lazy, but only with respect to promotion > of arguments to 'int'. > > Richard. > I set a breakpoint on the return type field for the builtin... A quick check shows the return type of the builtin is being changed to "unsigned int" here: #0  merge_decls (newdecl=0x7fffe9f67100, olddecl=0x7fffe9ed2100, newtype=0x7fffe9e3ae70, oldtype=0x7fffe9e3ae70) at /gcc/master/gcc/gcc/c/c-decl.c:2598 #1  0x0000000000a0628d in duplicate_decls (newdecl=0x7fffe9f67100, olddecl=0x7fffe9ed2100) at /gcc/master/gcc/gcc/c/c-decl.c:2963 #2  0x0000000000a07464 in pushdecl (x=0x7fffe9f67100) at /gcc/master/gcc/gcc/c/c-decl.c:3256 #3  0x0000000000a1d113 in start_function (declspecs=0x37728b0, declarator=0x3772ae0, attributes=0x0) at /gcc/master/gcc/gcc/c/c-decl.c:9644 #4  0x0000000000a8667c in c_parser_declaration_or_fndef (parser=0x7ffff7ff7ab0, fndef_ok=true, static_assert_ok=true, empty_ok=true, nested=false, start_attr_ok=true, objc_foreach_object_declaration=0x0,     omp_declare_simd_clauses=0x0, have_attrs=false, attrs=0x0, oacc_routine_data=0x0, fallthru_attr_p=0x0) at /gcc/master/gcc/gcc/c/c-parser.c:2444 It would appear that merge_decls is merging the olddecl (the bultin) with newdecl  and results in changing the LHS to unsigned int, so now it thinks the builtin matches.   eeeks. I don't know what the correct thing to do is, but a quick hack to check if old_decl is a builtin and return false from duplicate_decl also seems to resolve the problem: diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 221a67fe57b..27ab6ac9f1a 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -2960,6 +2960,9 @@ duplicate_decls (tree newdecl, tree olddecl)        return false;      } +  if (DECL_BUILT_IN_CLASS (olddecl) != NOT_BUILT_IN) +    return false; +    merge_decls (newdecl, olddecl, newtype, oldtype);    /* The NEWDECL will no longer be needed. To declare a filtering error, please use the following link : https://www.security-mail.net/reporter.php?mid=14e68.61127dac.234a0.0&r=marc.poulhies%40kalray.eu&s=gcc-patches-bounces%2Bmarc.poulhies%3Dkalray.eu%40gcc.gnu.org&o=Re%3A+%5BCOMMITTED%5D+PR+tree-optimization%2F101741+-+Ensure+toupper+and+tolower+follow+the+expected+pattern.&verdict=C&c=3fea457da484485891727e6a67eb7e2bee797a0c --C7D3E3D3B0BF.1628601774/fx302.security-mail.net--