On Mon, Jan 19, 2026 at 11:23 AM Alexandre Oliva <[email protected]> wrote:
>
>
> The expected cxa_atexit calls and optimizations won't take place on
> targets that don't have -fuse-cxa-atexit enabled by default.  Enabling
> it explicitly is enough to meet the expectations of the cxa_atexit
> tests.
>
> Regstrapped on x86_64-linux-gnu.  Also tested with aarch64-elf and
> arm-eabi with gcc-15.  Ok to install?

Ok. Also I am sorry I missed that -fuse-cxa-atexit was needed on these
testcases when I added them.

>
>
> for  gcc/testsuite/ChangeLog
>
>         * g++.dg/tree-ssa/cxa_atexit-1.C: Enable -fuse-cxa-atexit.
>         * g++.dg/tree-ssa/cxa_atexit-2.C: Likewise.
>         * g++.dg/tree-ssa/cxa_atexit-3.C: Likewise.
>         * g++.dg/tree-ssa/cxa_atexit-4.C: Likewise.
>         * g++.dg/tree-ssa/cxa_atexit-5.C: Likewise.
>         * g++.dg/tree-ssa/cxa_atexit-6.C: Likewise.
> ---
>  gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-1.C |    1 +
>  gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-2.C |    1 +
>  gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-3.C |    1 +
>  gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-4.C |    1 +
>  gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-5.C |    1 +
>  gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-6.C |    1 +
>  6 files changed, 6 insertions(+)
>
> diff --git a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-1.C 
> b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-1.C
> index 82ff3d2b77838..2c725402c7da2 100644
> --- a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-1.C
> +++ b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-1.C
> @@ -1,6 +1,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-O2 -fdump-tree-cddce1-details -fdump-tree-optimized" } */
>  // { dg-require-effective-target cxa_atexit }
> +// { dg-additional-options "-fuse-cxa-atexit" }
>  /* PR tree-optimization/19661 */
>
>  /* The call to axexit should be removed as A::~A() is a pure/const function 
> call
> diff --git a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-2.C 
> b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-2.C
> index 726b6d7f1561a..6a8c3de84870c 100644
> --- a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-2.C
> +++ b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-2.C
> @@ -1,6 +1,7 @@
>  /* { dg-do compile { target c++11 } } */
>  /* { dg-options "-O2 -fdump-tree-cddce1-details -fdump-tree-optimized" } */
>  // { dg-require-effective-target cxa_atexit }
> +// { dg-additional-options "-fuse-cxa-atexit" }
>  /* PR tree-optimization/19661 */
>
>  /* The call to axexit should be not removed as A::~A() as it marked with 
> noipa.  */
> diff --git a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-3.C 
> b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-3.C
> index 42cc7ccb11baf..cf0f086ca3b91 100644
> --- a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-3.C
> +++ b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-3.C
> @@ -1,6 +1,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-O2 -fdump-tree-cddce1-details -fdump-tree-optimized" } */
>  // { dg-require-effective-target cxa_atexit }
> +// { dg-additional-options "-fuse-cxa-atexit" }
>  /* PR tree-optimization/19661 */
>
>  /* We should not remove the call to atexit as A::~A is unknown.  */
> diff --git a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-4.C 
> b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-4.C
> index 591c1c0552a19..18467ed9b6fb3 100644
> --- a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-4.C
> +++ b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-4.C
> @@ -1,6 +1,7 @@
>  /* { dg-do compile { target c++11 } } */
>  /* { dg-options "-O2 -fdump-tree-cddce1-details -fdump-tree-optimized -w" } 
> */
>  // { dg-require-effective-target cxa_atexit }
> +// { dg-additional-options "-fuse-cxa-atexit" }
>  /* PR tree-optimization/19661 */
>
>  /* The call to axexit should be removed as A::~A() is a pure/const function 
> call
> diff --git a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-5.C 
> b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-5.C
> index e59f70c1ed4aa..c37cd353a09c1 100644
> --- a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-5.C
> +++ b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-5.C
> @@ -1,6 +1,7 @@
>  /* { dg-do compile { target c++20 } } */
>  /* { dg-options "-O2 -fdump-tree-dce2-details -fdump-tree-optimized" } */
>  // { dg-require-effective-target cxa_atexit }
> +// { dg-additional-options "-fuse-cxa-atexit" }
>  /* PR tree-optimization/19661 */
>
>  /* The call to axexit should be removed as constant_init::~constant_init is 
> a pure/const function call
> diff --git a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-6.C 
> b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-6.C
> index e22036067dd4f..cbdfe723afb90 100644
> --- a/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-6.C
> +++ b/gcc/testsuite/g++.dg/tree-ssa/cxa_atexit-6.C
> @@ -2,6 +2,7 @@
>  /* { dg-require-effective-target fpic } */
>  /* { dg-options "-O2 -fdump-tree-cddce1-details -fdump-tree-optimized -fPIC" 
> } */
>  // { dg-require-effective-target cxa_atexit }
> +// { dg-additional-options "-fuse-cxa-atexit" }
>  /* This test is not appropriate for targets where non-weak functions defined
>     in the TU always bind locally; see PR114982.  */
>  /* { dg-skip-if "PR114982" { *-*-darwin* } } */
>
> --
> Alexandre Oliva, happy hacker            https://blog.lx.oliva.nom.br/
> Free Software Activist     FSFLA co-founder     GNU Toolchain Engineer
> More tolerance and less prejudice are key for inclusion and diversity.
> Excluding neuro-others for not behaving ""normal"" is *not* inclusive!

Reply via email to