From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id EFC6B3858C39 for ; Fri, 13 Jan 2023 17:31:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EFC6B3858C39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pj1-x1033.google.com with SMTP id o18so1920127pji.1 for ; Fri, 13 Jan 2023 09:31:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=5IjfnN7YjUy3CVjK6OprGWGQYLAb1+BeFh5+aCXZAj8=; b=BBJXYGHFfq4t8kFXZ2hYqzkMp4M7WyN1VSICgjZ/f33FpO3wPXwtK7BmITWEBnKs4q HkjlUq5nkH6vWn352ArEDpmrcQnBdRPVZeh1AUQqoyzYNXB6+N/p9mCqrfNnDmws4TxA P3GXHCAZ2yxjm+e5DGycIKM0bFS2HjXOChw1udErqpBKI+VfFQPfUpXulklRXnwWa9gY Gxgrj3YFpX0ka7Y0/VLnjgeAf7LO0gghIDnECA5N8JNsYFkicxBTuOjzullRJ8KLgSt7 QCk1BHiD/WSKvSB8GkCb18qflV9+TclKg+99mOhtSSzN+egk+QeYYNb46qImzBykKE0H YEoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5IjfnN7YjUy3CVjK6OprGWGQYLAb1+BeFh5+aCXZAj8=; b=4SWwtk3sVmvkynl7sfJ+YNkdcXRkt/Wu0hvllATAkg+MQWBSb/l3+pWX7klvjQWuix 0mcOzvee3bJ9zSgiDe5bcpo9q+rtH3cRuKanEM0jze1A/S3kTZ5z7+c93i/X8CWYe5w3 k2Ax3iRI0ZbPCU/fWofbIrU+FYCbqCJ52q8lE/RSBAziMF+0NftPrxo1SydQWulJHvUO BKsGwVwp+ltqan0YW/d4csa1jV1mNC8oB8ggVN/v47s9aVHvbf/OXmgf7vIGx6/W/ngS UGQBHgS/ZarrYuIlSfI+J4JnCI3UGmBtfO/DT51N6FPBEsYK5qwHqvU5Sod5lDRd8PET BYIg== X-Gm-Message-State: AFqh2kqs4dWhETxSYn/z8EdAeAU5P1JvDc8KmDiCGhcPkDJxR8HdlTkN Yy+YmWsOfPSkMsTLRIrrLfJgEJEV/kV0xN7V X-Google-Smtp-Source: AMrXdXvtBMtNh5piovkcjcmy9wLT38Ir17ry5yHf+UhL5I2ulp3DFCn+6A+HecAtU8JdJQR2/OH9Nw== X-Received: by 2002:a17:902:f786:b0:192:9d79:d3d6 with SMTP id q6-20020a170902f78600b001929d79d3d6mr66762849pln.69.1673631116564; Fri, 13 Jan 2023 09:31:56 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id t1-20020a170902d14100b00186b3c3e2dasm14451675plt.155.2023.01.13.09.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 09:31:56 -0800 (PST) Date: Fri, 13 Jan 2023 09:31:56 -0800 (PST) X-Google-Original-Date: Fri, 13 Jan 2023 09:31:18 PST (-0800) Subject: Re: [PATCH] gimple-fold.h: Add missing gimple-iterator.h In-Reply-To: CC: gcc-patches@gcc.gnu.org From: Palmer Dabbelt To: richard.guenther@gmail.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 11 Jan 2023 23:55:15 PST (-0800), richard.guenther@gmail.com wrote: > On Thu, Jan 12, 2023 at 2:46 AM Palmer Dabbelt wrote: >> >> As of 6f5b06032eb ("Finish gimple_build API enhancement") gimple-fold.h >> uses some of the declarations from gimple-iterator.h, which causes >> issues when building Linux's stackprotector plugin. >> >> gcc/ChangeLog: >> >> * gimple-fold.h: Add gimple-iterator.h include. >> >> --- >> >> I'm not sure if this should instead be fixed in Linux by reordering the >> includes along the lines of >> >> diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h >> index 9a1895747b15..2c3a3079128a 100644 >> --- a/scripts/gcc-plugins/gcc-common.h >> +++ b/scripts/gcc-plugins/gcc-common.h >> @@ -72,6 +72,7 @@ >> #include "stor-layout.h" >> #include "internal-fn.h" >> #include "gimple-expr.h" >> +#include "gimple-iterator.h" >> #include "gimple-fold.h" >> #include "context.h" >> #include "tree-ssa-alias.h" >> @@ -88,7 +89,6 @@ >> #include "gimple.h" >> #include "tree-phinodes.h" >> #include "tree-cfg.h" >> -#include "gimple-iterator.h" >> #include "gimple-ssa.h" >> #include "ssa-iterators.h" > > The above change is OK. > >> but I figured it was slightly easier for users to keep these compatible. >> It looks like many GCC-internal uses of gimple-fold.h already have the >> gimple-iterator.h include right before, though, so not sure if that's >> how things are meant to be. >> --- >> gcc/gimple-fold.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/gcc/gimple-fold.h b/gcc/gimple-fold.h >> index 2fd58db9a2e..66bee2b75df 100644 >> --- a/gcc/gimple-fold.h >> +++ b/gcc/gimple-fold.h >> @@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see >> #ifndef GCC_GIMPLE_FOLD_H >> #define GCC_GIMPLE_FOLD_H >> >> +#include "gimple-iterator.h" >> + > > But this is not - we try to avoid #include directives in headers, we want the > include dependences to be "flat" Makes sense. I've sent the diff above to Linux: https://lore.kernel.org/r/20230113173033.4380-1-palmer@rivosinc.com/ > >> extern tree create_tmp_reg_or_ssa_name (tree, gimple *stmt = NULL); >> extern tree canonicalize_constructor_val (tree, tree); >> extern tree get_symbol_constant_value (tree); >> -- >> 2.39.0 >>