From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id DD2B33858C55 for ; Sat, 7 May 2022 19:58:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DD2B33858C55 Received: by mail-wr1-x429.google.com with SMTP id j15so14293755wrb.2 for ; Sat, 07 May 2022 12:58:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:message-id:subject:mime-version :list-id; bh=aIF1uv3AfBmX9sBdRnOhJOBBLcChs7xfKibDfKG98uw=; b=DwjyFrIG/S6gFM2SIncygjZPHQEfZpDsa7aSB0CsuCMTu/UuwpfROxJqnEqHqRuzf5 Zfi8Sy6Jab280rnOCi++tLeYH6X2qfcunHSSbOA6U3Maku7ZaCvLS+XgAgPxGC6XESpN TeHUTDs9mHtYZtprg1BcI+Mc7ytVT5BrA1H3vFZsYl0tBHShpyJGWsEQFpySM9Wr72DG sRiq2bZhussGnL909bKbLQfUogjAw6nqxxQ9pSvDp0eoS49N3CL31xvItMNoBIxWmqrH qZJVBsMH3QzVSK3Ot42mZn68UpFKJijD9GJz0YSNTN12m83XHwj0J9pF/ASJJ2L2oXSe VIiw== X-Gm-Message-State: AOAM532nkSsx9h17Uo18y95Zi0dsy/XoTnxtAOpfcNIsvg1gLFJtTlVR Sar/iwMgTbMPNePncg+Y31geOA== X-Google-Smtp-Source: ABdhPJxy4ye5uolLNgKTgx2btMJrbRnI7uG4q/FTa1BMw6faGylbKk3OYQTyG2xk6ygtv0OSMt88CQ== X-Received: by 2002:a5d:53c1:0:b0:20a:db5d:2590 with SMTP id a1-20020a5d53c1000000b0020adb5d2590mr7389698wrw.411.1651953500549; Sat, 07 May 2022 12:58:20 -0700 (PDT) Received: from jenkins.jenkins (ci.linaro.org. [88.99.136.175]) by smtp.gmail.com with ESMTPSA id k7-20020a05600c1c8700b003946433a829sm7912464wms.11.2022.05.07.12.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 May 2022 12:58:20 -0700 (PDT) From: ci_notify@linaro.org X-Google-Original-From: linaro-infrastructure-errors@lists.linaro.org Date: Sat, 7 May 2022 19:58:19 +0000 (UTC) To: Jason Merrill Cc: gcc-regression@gcc.gnu.org Message-ID: <707347732.177.1651953500243@jenkins.jenkins> Subject: [TCWG CI] Regression caused by gcc: c++: empty base constexpr adjustment [PR105245] MIME-Version: 1.0 X-Jenkins-Job: TCWG Bisect tcwg_gnu_native_build/master-arm X-Jenkins-Result: SUCCESS X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-regression@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-regression mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2022 19:58:25 -0000 [TCWG CI] Regression caused by gcc: c++: empty base constexpr adjustment [PR105245]: commit 967cdbe66296535fa496b88406a1125c8acaf6e2 Author: Jason Merrill c++: empty base constexpr adjustment [PR105245] Results regressed to # reset_artifacts: -10 # true: 0 # build_abe binutils: 1 # First few build errors in logs: # 00:03:08 make[2]: [Makefile:1786: armv8l-unknown-linux-gnueabihf/bits/largefile-config.h] Error 1 (ignored) # 00:03:43 /home/tcwg-buildslave/workspace/tcwg_gnu_14/abe/builds/armv8l-unknown-linux-gnueabihf/armv8l-unknown-linux-gnueabihf/gcc-gcc.git~master-stage2/armv8l-unknown-linux-gnueabihf/libstdc++-v3/include/bits/basic_string.h:4023:3: internal compiler error: in cxx_eval_store_expression, at cp/constexpr.cc:5928 # 00:03:44 make[5]: *** [Makefile:562: sstream-inst.lo] Error 1 # 00:03:44 make[4]: *** [Makefile:781: all-recursive] Error 1 # 00:03:44 make[3]: *** [Makefile:576: all-recursive] Error 1 # 00:03:44 make[2]: *** [Makefile:501: all] Error 2 # 00:03:44 make[1]: *** [Makefile:12293: all-target-libstdc++-v3] Error 2 # 00:03:44 make: *** [Makefile:1034: all] Error 2 from # reset_artifacts: -10 # true: 0 # build_abe binutils: 1 # build_abe gcc: 2 # build_abe linux: 4 # build_abe glibc: 5 # build_abe gdb: 6 THIS IS THE END OF INTERESTING STUFF. BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT. This commit has regressed these CI configurations: - tcwg_gnu_native_build/master-arm First_bad build: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/9/artifact/artifacts/build-967cdbe66296535fa496b88406a1125c8acaf6e2/ Last_good build: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/9/artifact/artifacts/build-469c76f0d94d03e29467a9d1e77cd3613f46ac2f/ Baseline build: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/9/artifact/artifacts/build-baseline/ Even more details: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/9/artifact/artifacts/ Reproduce builds: mkdir investigate-gcc-967cdbe66296535fa496b88406a1125c8acaf6e2 cd investigate-gcc-967cdbe66296535fa496b88406a1125c8acaf6e2 # Fetch scripts git clone https://git.linaro.org/toolchain/jenkins-scripts # Fetch manifests and test.sh script mkdir -p artifacts/manifests curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/9/artifact/artifacts/manifests/build-baseline.sh --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/9/artifact/artifacts/manifests/build-parameters.sh --fail curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/9/artifact/artifacts/test.sh --fail chmod +x artifacts/test.sh # Reproduce the baseline build (build all pre-requisites) ./jenkins-scripts/tcwg_gnu-build.sh @@ artifacts/manifests/build-baseline.sh # Save baseline build state (which is then restored in artifacts/test.sh) mkdir -p ./bisect rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /gcc/ ./ ./bisect/baseline/ cd gcc # Reproduce first_bad build git checkout --detach 967cdbe66296535fa496b88406a1125c8acaf6e2 ../artifacts/test.sh # Reproduce last_good build git checkout --detach 469c76f0d94d03e29467a9d1e77cd3613f46ac2f ../artifacts/test.sh cd .. Full commit (up to 1000 lines): commit 967cdbe66296535fa496b88406a1125c8acaf6e2 Author: Jason Merrill Date: Tue Apr 12 17:46:59 2022 -0400 c++: empty base constexpr adjustment [PR105245] While looking at PR105245 in stage 4, I wanted to reorganize the code a bit, but it seemed prudent to defer that to stage 1. PR c++/105245 PR c++/100111 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_store_expression): Reorganize empty base handling. --- gcc/cp/constexpr.cc | 67 +++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index 9b1e71857fc..6c204ab2265 100644 --- a/gcc/cp/constexpr.cc +++ b/gcc/cp/constexpr.cc @@ -5718,6 +5718,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, releasing_vec ctors, indexes; auto_vec index_pos_hints; bool activated_union_member_p = false; + bool empty_base = false; while (!refs->is_empty ()) { if (*valp == NULL_TREE) @@ -5759,7 +5760,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, no_zero_init = CONSTRUCTOR_NO_CLEARING (*valp); enum tree_code code = TREE_CODE (type); - type = refs->pop(); + tree reftype = refs->pop(); tree index = refs->pop(); if (code == RECORD_TYPE && is_empty_field (index)) @@ -5768,7 +5769,12 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, fields, which confuses the middle-end. The code below will notice that we don't have a CONSTRUCTOR for our inner target and just return init. */ - break; + { + empty_base = true; + break; + } + + type = reftype; if (code == UNION_TYPE && CONSTRUCTOR_NELTS (*valp) && CONSTRUCTOR_ELT (*valp, 0)->index != index) @@ -5902,45 +5908,42 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, } } + if (*non_constant_p) + return t; + /* Don't share a CONSTRUCTOR that might be changed later. */ init = unshare_constructor (init); - if (*valp && TREE_CODE (*valp) == CONSTRUCTOR - && TREE_CODE (init) == CONSTRUCTOR) + gcc_checking_assert (!*valp || (same_type_ignoring_top_level_qualifiers_p + (TREE_TYPE (*valp), type))); + if (empty_base || !(same_type_ignoring_top_level_qualifiers_p + (TREE_TYPE (init), type))) + { + /* For initialization of an empty base, the original target will be + *(base*)this, evaluation of which resolves to the object + argument, which has the derived type rather than the base type. In + this situation, just evaluate the initializer and return, since + there's no actual data to store, and we didn't build a CONSTRUCTOR. */ + empty_base = true; + gcc_assert (is_empty_class (TREE_TYPE (init))); + if (!*valp) + { + /* But do make sure we have something in *valp. */ + *valp = build_constructor (type, nullptr); + CONSTRUCTOR_NO_CLEARING (*valp) = no_zero_init; + } + } + else if (*valp && TREE_CODE (*valp) == CONSTRUCTOR + && TREE_CODE (init) == CONSTRUCTOR) { /* An outer ctx->ctor might be pointing to *valp, so replace its contents. */ - if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (init), - TREE_TYPE (*valp))) - { - /* For initialization of an empty base, the original target will be - *(base*)this, evaluation of which resolves to the object - argument, which has the derived type rather than the base type. In - this situation, just evaluate the initializer and return, since - there's no actual data to store. */ - gcc_assert (is_empty_class (TREE_TYPE (init))); - return lval ? target : init; - } CONSTRUCTOR_ELTS (*valp) = CONSTRUCTOR_ELTS (init); TREE_CONSTANT (*valp) = TREE_CONSTANT (init); TREE_SIDE_EFFECTS (*valp) = TREE_SIDE_EFFECTS (init); CONSTRUCTOR_NO_CLEARING (*valp) = CONSTRUCTOR_NO_CLEARING (init); } - else if (TREE_CODE (init) == CONSTRUCTOR - && !same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (init), - type)) - { - /* See above on initialization of empty bases. */ - gcc_assert (is_empty_class (TREE_TYPE (init)) && !lval); - if (!*valp) - { - /* But do make sure we have something in *valp. */ - *valp = build_constructor (type, nullptr); - CONSTRUCTOR_NO_CLEARING (*valp) = no_zero_init; - } - return init; - } else *valp = init; @@ -5958,7 +5961,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, constructor of a delegating constructor). Leave it up to the caller that set 'this' to set TREE_READONLY appropriately. */ gcc_checking_assert (same_type_ignoring_top_level_qualifiers_p - (TREE_TYPE (target), type)); + (TREE_TYPE (target), type) || empty_base); else TREE_READONLY (*valp) = true; } @@ -5980,9 +5983,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, CONSTRUCTOR_NO_CLEARING (elt) = false; } - if (*non_constant_p) - return t; - else if (lval) + if (lval) return target; else return init; >>From ci_notify@linaro.org Sat May 7 23:10:48 2022 Return-Path: X-Original-To: gcc-regression@gcc.gnu.org Delivered-To: gcc-regression@gcc.gnu.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 1DC443858C55 for ; Sat, 7 May 2022 23:10:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1DC443858C55 Received: by mail-wr1-x431.google.com with SMTP id q23so14705163wra.1 for ; Sat, 07 May 2022 16:10:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:message-id:subject:mime-version :list-id; bh=jiJaoNzfeKsjeojH0gyxxiULEfbJOfnI4XTp3mHbGSE=; b=24/St2nXlP1cb2BRC/BkHyZDf/GdNeBhowcTPmVvjk23LX+v/bWXCPwfggjRpuBvei vjUlVtIAu8++h0zBu7llPrGoIBxMV4CxgV8x3yqhLP89K2A7Yd5JD4QN7zWxk56+fsYc ils6F9W7XqR8fTvr5mCCE4Dh2kK+bCxu5Ze4up7Hc1aqNSSB0eBSkHDBZUPrszxMkE8G yM3v/d0Gv/TTxf54v5LqucVJ3xOp/OHPj6UUQJgAertnW3uZPHCCSnCz7Vp3HYDebFPQ w0wHFhxL7DxFnGbsOSFrSygt8GqTkut/je6P9W3jtvT4ZgzEJaO8k039phXccKyaiMix d2gw== X-Gm-Message-State: AOAM5302R9Nt2es5fUYzPH+RaxoXXQDWDEARN0UEEkJmG3MuD5pk6Zsi iVV1y24xZFmrxWb916IH2kTvzQ== X-Google-Smtp-Source: ABdhPJw/vNBuN7kRwyuxpkqY3bmGDr8h2C36en+rLPzFb1rXSghioKYPiGxHxNs6tAy2CzNYQyIBYQ== X-Received: by 2002:a5d:6488:0:b0:203:b628:70d2 with SMTP id o8-20020a5d6488000000b00203b62870d2mr8109366wri.83.1651965044807; Sat, 07 May 2022 16:10:44 -0700 (PDT) Received: from jenkins.jenkins (ci.linaro.org. [88.99.136.175]) by smtp.gmail.com with ESMTPSA id o9-20020a5d62c9000000b0020c5253d903sm7153559wrv.79.2022.05.07.16.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 May 2022 16:10:44 -0700 (PDT) From: ci_notify@linaro.org X-Google-Original-From: linaro-infrastructure-errors@lists.linaro.org Date: Sat, 7 May 2022 23:10:43 +0000 (UTC) To: Jason Merrill Cc: gcc-regression@gcc.gnu.org Message-ID: <1881808766.218.1651965044459@jenkins.jenkins> Subject: [TCWG CI] Regression caused by gcc: c++: empty base constexpr adjustment [PR105245] MIME-Version: 1.0 X-Jenkins-Job: TCWG Bisect tcwg_gnu_cross_build/master-arm X-Jenkins-Result: SUCCESS X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-regression@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-regression mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2022 23:10:48 -0000 [TCWG CI] Regression caused by gcc: c++: empty base constexpr adjustment [PR105245]: commit 967cdbe66296535fa496b88406a1125c8acaf6e2 Author: Jason Merrill c++: empty base constexpr adjustment [PR105245] Results regressed to # reset_artifacts: -10 # true: 0 # build_abe binutils: 1 # build_abe stage1: 2 # build_abe linux: 3 # build_abe glibc: 4 # First few build errors in logs: # 00:05:24 make[2]: [Makefile:1786: arm-linux-gnueabihf/bits/largefile-config.h] Error 1 (ignored) # 00:06:27 /home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/builds/x86_64-pc-linux-gnu/arm-linux-gnueabihf/gcc-gcc.git~master-stage2/arm-linux-gnueabihf/libstdc++-v3/include/bits/basic_string.h:4023:3: internal compiler error: in cxx_eval_store_expression, at cp/constexpr.cc:5928 # 00:06:28 make[5]: *** [Makefile:562: sstream-inst.lo] Error 1 # 00:06:28 make[4]: *** [Makefile:781: all-recursive] Error 1 # 00:06:28 make[3]: *** [Makefile:576: all-recursive] Error 1 # 00:06:28 make[2]: *** [Makefile:501: all] Error 2 # 00:06:28 make[1]: *** [Makefile:12293: all-target-libstdc++-v3] Error 2 # 00:06:28 make: *** [Makefile:1034: all] Error 2 from # reset_artifacts: -10 # true: 0 # build_abe binutils: 1 # build_abe stage1: 2 # build_abe linux: 3 # build_abe glibc: 4 # build_abe stage2: 5 # build_abe gdb: 6 # build_abe qemu: 7 THIS IS THE END OF INTERESTING STUFF. BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT. This commit has regressed these CI configurations: - tcwg_gnu_cross_build/master-arm First_bad build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/28/artifact/artifacts/build-967cdbe66296535fa496b88406a1125c8acaf6e2/ Last_good build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/28/artifact/artifacts/build-469c76f0d94d03e29467a9d1e77cd3613f46ac2f/ Baseline build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/28/artifact/artifacts/build-baseline/ Even more details: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/28/artifact/artifacts/ Reproduce builds: mkdir investigate-gcc-967cdbe66296535fa496b88406a1125c8acaf6e2 cd investigate-gcc-967cdbe66296535fa496b88406a1125c8acaf6e2 # Fetch scripts git clone https://git.linaro.org/toolchain/jenkins-scripts # Fetch manifests and test.sh script mkdir -p artifacts/manifests curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/28/artifact/artifacts/manifests/build-baseline.sh --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/28/artifact/artifacts/manifests/build-parameters.sh --fail curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/28/artifact/artifacts/test.sh --fail chmod +x artifacts/test.sh # Reproduce the baseline build (build all pre-requisites) ./jenkins-scripts/tcwg_gnu-build.sh @@ artifacts/manifests/build-baseline.sh # Save baseline build state (which is then restored in artifacts/test.sh) mkdir -p ./bisect rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /gcc/ ./ ./bisect/baseline/ cd gcc # Reproduce first_bad build git checkout --detach 967cdbe66296535fa496b88406a1125c8acaf6e2 ../artifacts/test.sh # Reproduce last_good build git checkout --detach 469c76f0d94d03e29467a9d1e77cd3613f46ac2f ../artifacts/test.sh cd .. Full commit (up to 1000 lines): commit 967cdbe66296535fa496b88406a1125c8acaf6e2 Author: Jason Merrill Date: Tue Apr 12 17:46:59 2022 -0400 c++: empty base constexpr adjustment [PR105245] While looking at PR105245 in stage 4, I wanted to reorganize the code a bit, but it seemed prudent to defer that to stage 1. PR c++/105245 PR c++/100111 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_store_expression): Reorganize empty base handling. --- gcc/cp/constexpr.cc | 67 +++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index 9b1e71857fc..6c204ab2265 100644 --- a/gcc/cp/constexpr.cc +++ b/gcc/cp/constexpr.cc @@ -5718,6 +5718,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, releasing_vec ctors, indexes; auto_vec index_pos_hints; bool activated_union_member_p = false; + bool empty_base = false; while (!refs->is_empty ()) { if (*valp == NULL_TREE) @@ -5759,7 +5760,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, no_zero_init = CONSTRUCTOR_NO_CLEARING (*valp); enum tree_code code = TREE_CODE (type); - type = refs->pop(); + tree reftype = refs->pop(); tree index = refs->pop(); if (code == RECORD_TYPE && is_empty_field (index)) @@ -5768,7 +5769,12 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, fields, which confuses the middle-end. The code below will notice that we don't have a CONSTRUCTOR for our inner target and just return init. */ - break; + { + empty_base = true; + break; + } + + type = reftype; if (code == UNION_TYPE && CONSTRUCTOR_NELTS (*valp) && CONSTRUCTOR_ELT (*valp, 0)->index != index) @@ -5902,45 +5908,42 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, } } + if (*non_constant_p) + return t; + /* Don't share a CONSTRUCTOR that might be changed later. */ init = unshare_constructor (init); - if (*valp && TREE_CODE (*valp) == CONSTRUCTOR - && TREE_CODE (init) == CONSTRUCTOR) + gcc_checking_assert (!*valp || (same_type_ignoring_top_level_qualifiers_p + (TREE_TYPE (*valp), type))); + if (empty_base || !(same_type_ignoring_top_level_qualifiers_p + (TREE_TYPE (init), type))) + { + /* For initialization of an empty base, the original target will be + *(base*)this, evaluation of which resolves to the object + argument, which has the derived type rather than the base type. In + this situation, just evaluate the initializer and return, since + there's no actual data to store, and we didn't build a CONSTRUCTOR. */ + empty_base = true; + gcc_assert (is_empty_class (TREE_TYPE (init))); + if (!*valp) + { + /* But do make sure we have something in *valp. */ + *valp = build_constructor (type, nullptr); + CONSTRUCTOR_NO_CLEARING (*valp) = no_zero_init; + } + } + else if (*valp && TREE_CODE (*valp) == CONSTRUCTOR + && TREE_CODE (init) == CONSTRUCTOR) { /* An outer ctx->ctor might be pointing to *valp, so replace its contents. */ - if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (init), - TREE_TYPE (*valp))) - { - /* For initialization of an empty base, the original target will be - *(base*)this, evaluation of which resolves to the object - argument, which has the derived type rather than the base type. In - this situation, just evaluate the initializer and return, since - there's no actual data to store. */ - gcc_assert (is_empty_class (TREE_TYPE (init))); - return lval ? target : init; - } CONSTRUCTOR_ELTS (*valp) = CONSTRUCTOR_ELTS (init); TREE_CONSTANT (*valp) = TREE_CONSTANT (init); TREE_SIDE_EFFECTS (*valp) = TREE_SIDE_EFFECTS (init); CONSTRUCTOR_NO_CLEARING (*valp) = CONSTRUCTOR_NO_CLEARING (init); } - else if (TREE_CODE (init) == CONSTRUCTOR - && !same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (init), - type)) - { - /* See above on initialization of empty bases. */ - gcc_assert (is_empty_class (TREE_TYPE (init)) && !lval); - if (!*valp) - { - /* But do make sure we have something in *valp. */ - *valp = build_constructor (type, nullptr); - CONSTRUCTOR_NO_CLEARING (*valp) = no_zero_init; - } - return init; - } else *valp = init; @@ -5958,7 +5961,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, constructor of a delegating constructor). Leave it up to the caller that set 'this' to set TREE_READONLY appropriately. */ gcc_checking_assert (same_type_ignoring_top_level_qualifiers_p - (TREE_TYPE (target), type)); + (TREE_TYPE (target), type) || empty_base); else TREE_READONLY (*valp) = true; } @@ -5980,9 +5983,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, CONSTRUCTOR_NO_CLEARING (elt) = false; } - if (*non_constant_p) - return t; - else if (lval) + if (lval) return target; else return init; >>From ci_notify@linaro.org Sun May 8 02:00:05 2022 Return-Path: X-Original-To: gcc-regression@gcc.gnu.org Delivered-To: gcc-regression@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 3E9F63858C53 for ; Sun, 8 May 2022 02:00:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3E9F63858C53 Received: by mail-wm1-x32c.google.com with SMTP id m2-20020a1ca302000000b003943bc63f98so6487587wme.4 for ; Sat, 07 May 2022 19:00:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:message-id:subject:mime-version :list-id; bh=5PuRgBwr2w/4POV38KGS6PMk9PflZ4FzmN9pdXquqio=; b=vFzeDDGDe8rPs3JlO6P5Wvr39Wv0WpvSL9wERO6vfIFnA+sv/OU1dWmbt5M7y4GZzX R7Q14wOlTUk4RGh0Tp4CfbKZMPpWshY5FtroWLW4Gd8TrFmQ65eWFyhtFxKZORIEMrkK 6KjakV2IXrhS0wWMjcDCXQV9pYivOPpHiPYpkw384fS2HPUosXTxnIuMCaWwLchq3nLs IP2WN6qGUHas0hTQLnVr2aNG3EV75j3IvyfChfIE/v3Wa0fl6XCXiSNEH2td4YlVSXyS k/Jlxrx7+oYd6l7Vn9agp0YW9O5AhZxuqS/vueFcSkNTrmqmF+ebqBJCohirVLyDcxk4 4Iug== X-Gm-Message-State: AOAM533tyL1W30E74e906A3Y2czE93qyouU93zD3Ld1rli19PiiRvlTj RiUt6kmLYyrbmrto5nHw1rCOcA== X-Google-Smtp-Source: ABdhPJzuuIDcLA+FEovD93yi6EKhbjw4DR4ksjqZLKpS1Jy900fBrT2ofaFoRJtGF1lfhS4UFz3xAg== X-Received: by 2002:a1c:3b54:0:b0:394:3910:3cb9 with SMTP id i81-20020a1c3b54000000b0039439103cb9mr16221053wma.50.1651975199988; Sat, 07 May 2022 18:59:59 -0700 (PDT) Received: from jenkins.jenkins (ci.linaro.org. [88.99.136.175]) by smtp.gmail.com with ESMTPSA id l124-20020a1c2582000000b0039482d95ab7sm3254855wml.24.2022.05.07.18.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 May 2022 18:59:59 -0700 (PDT) From: ci_notify@linaro.org X-Google-Original-From: linaro-infrastructure-errors@lists.linaro.org Date: Sun, 8 May 2022 01:59:58 +0000 (UTC) To: Jason Merrill Cc: gcc-regression@gcc.gnu.org Message-ID: <1215847361.261.1651975199310@jenkins.jenkins> Subject: [TCWG CI] Regression caused by gcc: c++: empty base constexpr adjustment [PR105245] MIME-Version: 1.0 X-Jenkins-Job: TCWG Bisect tcwg_gnu_cross_build/master-arm X-Jenkins-Result: SUCCESS X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-regression@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-regression mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2022 02:00:05 -0000 [TCWG CI] Regression caused by gcc: c++: empty base constexpr adjustment [PR105245]: commit 967cdbe66296535fa496b88406a1125c8acaf6e2 Author: Jason Merrill c++: empty base constexpr adjustment [PR105245] Results regressed to # reset_artifacts: -10 # true: 0 # build_abe binutils: 1 # build_abe stage1: 2 # build_abe linux: 3 # build_abe glibc: 4 # First few build errors in logs: # 00:07:35 make[2]: [Makefile:1786: arm-linux-gnueabihf/bits/largefile-config.h] Error 1 (ignored) # 00:08:35 /home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/builds/x86_64-pc-linux-gnu/arm-linux-gnueabihf/gcc-gcc.git~master-stage2/arm-linux-gnueabihf/libstdc++-v3/include/bits/basic_string.h:4023:3: internal compiler error: in cxx_eval_store_expression, at cp/constexpr.cc:5928 # 00:08:35 make[5]: *** [Makefile:562: sstream-inst.lo] Error 1 # 00:08:35 make[4]: *** [Makefile:781: all-recursive] Error 1 # 00:08:35 make[3]: *** [Makefile:576: all-recursive] Error 1 # 00:08:35 make[2]: *** [Makefile:501: all] Error 2 # 00:08:35 make[1]: *** [Makefile:12293: all-target-libstdc++-v3] Error 2 # 00:08:35 make: *** [Makefile:1034: all] Error 2 from # reset_artifacts: -10 # true: 0 # build_abe binutils: 1 # build_abe stage1: 2 # build_abe linux: 3 # build_abe glibc: 4 # build_abe stage2: 5 # build_abe gdb: 6 # build_abe qemu: 7 THIS IS THE END OF INTERESTING STUFF. BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT. This commit has regressed these CI configurations: - tcwg_gnu_cross_build/master-arm First_bad build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/29/artifact/artifacts/build-967cdbe66296535fa496b88406a1125c8acaf6e2/ Last_good build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/29/artifact/artifacts/build-469c76f0d94d03e29467a9d1e77cd3613f46ac2f/ Baseline build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/29/artifact/artifacts/build-baseline/ Even more details: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/29/artifact/artifacts/ Reproduce builds: mkdir investigate-gcc-967cdbe66296535fa496b88406a1125c8acaf6e2 cd investigate-gcc-967cdbe66296535fa496b88406a1125c8acaf6e2 # Fetch scripts git clone https://git.linaro.org/toolchain/jenkins-scripts # Fetch manifests and test.sh script mkdir -p artifacts/manifests curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/29/artifact/artifacts/manifests/build-baseline.sh --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/29/artifact/artifacts/manifests/build-parameters.sh --fail curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/29/artifact/artifacts/test.sh --fail chmod +x artifacts/test.sh # Reproduce the baseline build (build all pre-requisites) ./jenkins-scripts/tcwg_gnu-build.sh @@ artifacts/manifests/build-baseline.sh # Save baseline build state (which is then restored in artifacts/test.sh) mkdir -p ./bisect rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /gcc/ ./ ./bisect/baseline/ cd gcc # Reproduce first_bad build git checkout --detach 967cdbe66296535fa496b88406a1125c8acaf6e2 ../artifacts/test.sh # Reproduce last_good build git checkout --detach 469c76f0d94d03e29467a9d1e77cd3613f46ac2f ../artifacts/test.sh cd .. Full commit (up to 1000 lines): commit 967cdbe66296535fa496b88406a1125c8acaf6e2 Author: Jason Merrill Date: Tue Apr 12 17:46:59 2022 -0400 c++: empty base constexpr adjustment [PR105245] While looking at PR105245 in stage 4, I wanted to reorganize the code a bit, but it seemed prudent to defer that to stage 1. PR c++/105245 PR c++/100111 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_store_expression): Reorganize empty base handling. --- gcc/cp/constexpr.cc | 67 +++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index 9b1e71857fc..6c204ab2265 100644 --- a/gcc/cp/constexpr.cc +++ b/gcc/cp/constexpr.cc @@ -5718,6 +5718,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, releasing_vec ctors, indexes; auto_vec index_pos_hints; bool activated_union_member_p = false; + bool empty_base = false; while (!refs->is_empty ()) { if (*valp == NULL_TREE) @@ -5759,7 +5760,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, no_zero_init = CONSTRUCTOR_NO_CLEARING (*valp); enum tree_code code = TREE_CODE (type); - type = refs->pop(); + tree reftype = refs->pop(); tree index = refs->pop(); if (code == RECORD_TYPE && is_empty_field (index)) @@ -5768,7 +5769,12 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, fields, which confuses the middle-end. The code below will notice that we don't have a CONSTRUCTOR for our inner target and just return init. */ - break; + { + empty_base = true; + break; + } + + type = reftype; if (code == UNION_TYPE && CONSTRUCTOR_NELTS (*valp) && CONSTRUCTOR_ELT (*valp, 0)->index != index) @@ -5902,45 +5908,42 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, } } + if (*non_constant_p) + return t; + /* Don't share a CONSTRUCTOR that might be changed later. */ init = unshare_constructor (init); - if (*valp && TREE_CODE (*valp) == CONSTRUCTOR - && TREE_CODE (init) == CONSTRUCTOR) + gcc_checking_assert (!*valp || (same_type_ignoring_top_level_qualifiers_p + (TREE_TYPE (*valp), type))); + if (empty_base || !(same_type_ignoring_top_level_qualifiers_p + (TREE_TYPE (init), type))) + { + /* For initialization of an empty base, the original target will be + *(base*)this, evaluation of which resolves to the object + argument, which has the derived type rather than the base type. In + this situation, just evaluate the initializer and return, since + there's no actual data to store, and we didn't build a CONSTRUCTOR. */ + empty_base = true; + gcc_assert (is_empty_class (TREE_TYPE (init))); + if (!*valp) + { + /* But do make sure we have something in *valp. */ + *valp = build_constructor (type, nullptr); + CONSTRUCTOR_NO_CLEARING (*valp) = no_zero_init; + } + } + else if (*valp && TREE_CODE (*valp) == CONSTRUCTOR + && TREE_CODE (init) == CONSTRUCTOR) { /* An outer ctx->ctor might be pointing to *valp, so replace its contents. */ - if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (init), - TREE_TYPE (*valp))) - { - /* For initialization of an empty base, the original target will be - *(base*)this, evaluation of which resolves to the object - argument, which has the derived type rather than the base type. In - this situation, just evaluate the initializer and return, since - there's no actual data to store. */ - gcc_assert (is_empty_class (TREE_TYPE (init))); - return lval ? target : init; - } CONSTRUCTOR_ELTS (*valp) = CONSTRUCTOR_ELTS (init); TREE_CONSTANT (*valp) = TREE_CONSTANT (init); TREE_SIDE_EFFECTS (*valp) = TREE_SIDE_EFFECTS (init); CONSTRUCTOR_NO_CLEARING (*valp) = CONSTRUCTOR_NO_CLEARING (init); } - else if (TREE_CODE (init) == CONSTRUCTOR - && !same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (init), - type)) - { - /* See above on initialization of empty bases. */ - gcc_assert (is_empty_class (TREE_TYPE (init)) && !lval); - if (!*valp) - { - /* But do make sure we have something in *valp. */ - *valp = build_constructor (type, nullptr); - CONSTRUCTOR_NO_CLEARING (*valp) = no_zero_init; - } - return init; - } else *valp = init; @@ -5958,7 +5961,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, constructor of a delegating constructor). Leave it up to the caller that set 'this' to set TREE_READONLY appropriately. */ gcc_checking_assert (same_type_ignoring_top_level_qualifiers_p - (TREE_TYPE (target), type)); + (TREE_TYPE (target), type) || empty_base); else TREE_READONLY (*valp) = true; } @@ -5980,9 +5983,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t, CONSTRUCTOR_NO_CLEARING (elt) = false; } - if (*non_constant_p) - return t; - else if (lval) + if (lval) return target; else return init; >>From hjl@sc.intel.com Sun May 8 13:42:52 2022 Return-Path: X-Original-To: gcc-regression@gcc.gnu.org Delivered-To: gcc-regression@gcc.gnu.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by sourceware.org (Postfix) with ESMTPS id 3A3503858C27 for ; Sun, 8 May 2022 13:42:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3A3503858C27 X-IronPort-AV: E=McAfee;i="6400,9594,10341"; a="331853545" X-IronPort-AV: E=Sophos;i="5.91,208,1647327600"; d="scan'208";a="331853545" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2022 06:42:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,208,1647327600"; d="scan'208";a="569794212" Received: from scymds01.sc.intel.com ([10.148.94.138]) by fmsmga007.fm.intel.com with ESMTP; 08 May 2022 06:42:49 -0700 Received: from gnu-skl-2.sc.intel.com (gnu-skl-2.sc.intel.com [172.25.33.230]) by scymds01.sc.intel.com with ESMTP id 248Dgnwf008322; Sun, 8 May 2022 06:42:49 -0700 Received: by gnu-skl-2.sc.intel.com (Postfix, from userid 1000) id 87CDA3C002D; Sun, 8 May 2022 06:42:49 -0700 (PDT) Date: Sun, 08 May 2022 06:42:49 -0700 To: skpgkp2@gmail.com, hjl.tools@gmail.com, gcc-regression@gcc.gnu.org Subject: Regressions on releases/gcc-10 at commit r10-10598 vs commit r10-10588 on Linux/x86_64 User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20220508134249.87CDA3C002D@gnu-skl-2.sc.intel.com> From: "H.J. Lu" X-Spam-Status: No, score=-3463.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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-regression@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-regression mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2022 13:42:52 -0000 New failures: New passes: FAIL: gcc.dg/tree-prof/val-prof-1.c scan-tree-dump-times optimized "calloc" 2