From patchwork Wed May 23 08:42:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 918874 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478233-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="W4jgAGAK"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40rQyZ4gXPz9s15 for ; Wed, 23 May 2018 18:43:17 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=YqGJA180VN91DrLpj6czCbtmprWJoPZoTmh5zWFcmXjNvs5vQMyVx EXWP+FC0BAY9Rv9u3xOg1fd5rbVXhFv6qci8K2JVHVxjNHZ4Ixle19FxDGH1yyDp ewDY/d8VuxL3Qvxn0mvDjZrBpxEXbLgl4A4ZiF0zGLm9c2f8r/Tn3c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=VQLjPZWohs/lmch7CIRlOrOeyeE=; b=W4jgAGAKNuAcH0P4SxBJ T7aXT7lTwYiIHM2HumPPfwkpNfSlkTiwnXZsQoaIPmVD5NaJYoaYcT7q/+cUNHMr OtbelmcEVZo4pZffSb2KAPB6CLLgnsJGXqlxWmbzaOz678u3wz93Hb0lgq43V0n1 CtqKYokD6CCQGLxIdplyNso= Received: (qmail 119999 invoked by alias); 23 May 2018 08:43:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 113440 invoked by uid 89); 23 May 2018 08:43:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_PASS autolearn=ham version=3.3.2 spammy=optout, opt-out X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 May 2018 08:42:58 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 956FAAC0A for ; Wed, 23 May 2018 08:42:56 +0000 (UTC) Date: Wed, 23 May 2018 10:42:56 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Disable strict-overflow warnings from data-ref code Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 This silences an unhelpful warning about strict-overflow for the samba build. The warning is emitted from tree-data-ref.c:create_intersect_range_checks and ends up in the default input_location which is just the function scope. Bootstrapped and tested on x86_64-unknown-linux-gnu, will apply to trunk and branch. I guess we should eventually prune all input_location using warnings and make those strict-overflow warnings opt-in rather than opt-out? Thus only emit them from frontend triggered foldings? Thanks, Richard. 2018-05-23 Richard Biener * tree-data-ref.c (create_runtime_alias_checks): Defer and ignore overflow warnings. * gcc.dg/Wstrict-overflow-27.c: New testcase. Index: gcc/tree-data-ref.c =================================================================== --- gcc/tree-data-ref.c (revision 260306) +++ gcc/tree-data-ref.c (working copy) @@ -1918,6 +1918,7 @@ create_runtime_alias_checks (struct loop { tree part_cond_expr; + fold_defer_overflow_warnings (); for (size_t i = 0, s = alias_pairs->length (); i < s; ++i) { const dr_with_seg_len& dr_a = (*alias_pairs)[i].first; @@ -1940,6 +1941,7 @@ create_runtime_alias_checks (struct loop else *cond_expr = part_cond_expr; } + fold_undefer_and_ignore_overflow_warnings (); } /* Check if OFFSET1 and OFFSET2 (DR_OFFSETs of some data-refs) are identical Index: gcc/testsuite/gcc.dg/Wstrict-overflow-27.c =================================================================== --- gcc/testsuite/gcc.dg/Wstrict-overflow-27.c (nonexistent) +++ gcc/testsuite/gcc.dg/Wstrict-overflow-27.c (working copy) @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -Wstrict-overflow=2 -Werror" } */ + +typedef __SIZE_TYPE__ size_t; +extern char *strtok_r (char *__restrict __s, const char *__restrict __delim, + char **__restrict __save_ptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); +extern const unsigned short int **__ctype_b_loc (void) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern int *DEBUGLEVEL_CLASS; +size_t debug_num_classes = 0; +void debug_parse_param(char *param); +void +debug_parse_levels(const char *params_str, size_t str_len) +{ + char str[str_len+1]; + char *tok, *saveptr; + size_t i; + tok = strtok_r(str, " \t,\n\r", &saveptr); + if (((*__ctype_b_loc ())[(int) ((tok[0]))])) + tok = strtok_r(((void *)0), " \t,\n\r", &saveptr); + else + DEBUGLEVEL_CLASS[0] = 0; + for (i = 0 +1; i < debug_num_classes; i++) + DEBUGLEVEL_CLASS[i] = DEBUGLEVEL_CLASS[0]; + while (tok != ((void *)0) ) + debug_parse_param(tok); +}