So there is not enough history on these 2. They were added to the repo as -O9 back in 1997 when it looks like the testsuite was merged in a whole to the cvs. I suspect these testcases were failing at -O3 back then. So changing it to -O0 seems wrong and unwanted. Can you explain why you want to change them from -O9? GCC treats -O[4-9] the same as -O3 without a warning so there is no failure with GCC. Are you trying to compile the testsuite with say clang? I’m compiling these two tests with Clang, and Clang currently does not translate -O9 to -O3 under LTO. As a result, the linker fails because it does not recognize -O9. The Clang driver should probably handle -O9 by treating it as -O3 and passing -O3 to the linker.
That said, I don’t think these tests are meant to cover the -O9 option. I agree that we should use -O3 for both tests. ________________________________ 寄件者: Andrew Pinski <[email protected]> 寄件日期: 2025年11月20日 13:52 收件者: Jim Tsung-Chun Lin(林宗俊) <[email protected]> 副本: [email protected] <[email protected]> 主旨: Re: [PATCH 1/1] Fix typo in eh49.C and eh52.C: O9 -> O0 [EXTERNAL MAIL] On Wed, Nov 19, 2025 at 9:28 PM Jim Lin <[email protected]> wrote: > > I believe there is no reason to use -O9 for these two testcases. So I > assumed it was a typo. The number 9 is next to 0 on the keyboard. So there is not enough history on these 2. They were added to the repo as -O9 back in 1997 when it looks like the testsuite was merged in a whole to the cvs. I suspect these testcases were failing at -O3 back then. So changing it to -O0 seems wrong and unwanted. Can you explain why you want to change them from -O9? GCC treats -O[4-9] the same as -O3 without a warning so there is no failure with GCC. Are you trying to compile the testsuite with say clang? Thanks, Andrew > --- > gcc/testsuite/g++.old-deja/g++.mike/eh49.C | 2 +- > gcc/testsuite/g++.old-deja/g++.mike/eh52.C | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh49.C > b/gcc/testsuite/g++.old-deja/g++.mike/eh49.C > index 1380ca02d82..ac6e52baa20 100644 > --- a/gcc/testsuite/g++.old-deja/g++.mike/eh49.C > +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh49.C > @@ -1,5 +1,5 @@ > // { dg-do run { xfail sparc64-*-elf arm-*-pe } } > -// { dg-options "-fexceptions -O9" } > +// { dg-options "-fexceptions -O0" } > > void main1() { > throw 1; > diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh52.C > b/gcc/testsuite/g++.old-deja/g++.mike/eh52.C > index 18b477c098b..7f44dba265a 100644 > --- a/gcc/testsuite/g++.old-deja/g++.mike/eh52.C > +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh52.C > @@ -1,5 +1,5 @@ > // { dg-do run } > -// { dg-options "-fexceptions -O9" } > +// { dg-options "-fexceptions -O0" } > > int promote_mode (int mode, int *punsignedp) > { > -- > 2.43.5 > CONFIDENTIALITY NOTICE: This e-mail (and its attachments) may contain confidential and legally privileged information or information protected from disclosure. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein is strictly prohibited. In this case, please immediately notify the sender by return e-mail, delete the message (and any accompanying documents) and destroy all printed hard copies. Thank you for your cooperation. Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.
