Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On 10/13/21 1:43 AM, Kewen.Lin wrote: on 2021/10/13 下午2:29, Hongtao Liu via Gcc-patches wrote: On Wed, Oct 13, 2021 at 11:34 AM Hongtao Liu wrote: On Tue, Oct 12, 2021 at 11:49 PM Martin Sebor wrote: On 10/11/21 8:31 PM, Hongtao Liu wrote: On Tue, Oct 12, 2021 at 4:08 AM Martin Sebor via Gcc-patches wrote: On 10/11/21 11:43 AM, Segher Boessenkool wrote: On Mon, Oct 11, 2021 at 10:23:03AM -0600, Martin Sebor wrote: On 10/11/21 9:30 AM, Segher Boessenkool wrote: On Mon, Oct 11, 2021 at 10:47:00AM +0800, Kewen.Lin wrote: - For generic test cases, it follows the existing suggested practice with necessary target/xfail selector. Not such a great choice. Many of those tests do not make sense with vectorisation enabled. This should have been thought about, in some cases resulting in not running the test with vectorisation enabled, and in some cases duplicating the test, once with and once without vectorisation. The tests detect bugs that are present both with and without vetctorization, so they should pass both ways. Then it should be tested both ways! This is my point. Agreed. (Most warnings are tested with just one set of options, but it's becoming apparent that the middle end ones should be exercised more extensively.) That they don't tells us that that the warnings need work (they were written with an assumption that doesn't hold anymore). They were written in world A. In world B many things behave differently. Transplanting the testcases from A to B without any extra analysis will not test what the testcases wanted to test, and possibly nothing at all anymore. Absolutely. We need to track that work somehow, but simply xfailing them without making a record of what underlying problem the xfails correspond to isn't the best way. In my experience, what works well is opening a bug for each distinct limitation (if one doesn't already exist) and adding a reference to it as a comment to the xfail. Probably, yes. But you are just following established practice, so :-) I also am okay with this. If it was decided x86 does not have to deal with these (generic!) problems, then why should we do other people's work? I don't know that anything was decided. I think those changes were made in haste, and (as you noted in your review of these updates to them), were incomplete (missing comments referencing the underlying bugs or limitations). Now that we've noticed it we should try to fix it. I'm not expecting you (or Kwen) to do other people's work, but it would help to let them/us know that there is work for us to do. I only noticed the problem by luck. - struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } + struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } As I mentioned in the bug, when adding xfails for regressions please be sure to reference the bug that tracks the underlying root cause.] You are saying this to whoever added that x86 xfail I hope. In general it's an appeal to both authors and reviewers of such changes. Here, it's mostly for Hongtao who apparently added all these undocumented xfails. There may be multiple problems, and we need to identify what it is in each instance. As the author of the tests I can help with that but not if I'm not in the loop on these changes (it would seem prudent to get the author's thoughts on such sweeping changes to their work). Yup. I discussed one of these failures with Hongtao in detail at the time autovectorization was being enabled and made the same request then but I didn't realize the problem was so pervasive. In addition, the target-specific conditionals in the xfails are going to be difficult to maintain. It is a cop-out. Especially because it makes no comment why it is xfailed (which should *always* be explained!) It might be okay for one or two in a single test but for so many we need a better solution than that. If autovectorization is only enabled for a subset of targets then a solution might be to add a new DejagGNU test for it and conditionalize the xfails on it. That, combined with duplicating these tests and still testing the -fno-vectorization situation properly. Those tests tested something. With vectorisation enabled they might no longer test that same thing, especially if the test fails now! Right. The original autovectorization change was made either without a full analysis of its impact on the affected warnings, or its impact wasn't adequately captured (either in the xfails comments or by opening bugs for them). Now that we know about this we should try to fix it. The first step toward that is to review the xfailed test cases and for each add a comment with the bug that captures its root cause. Hongtao, please let me know if you are going to work on that. I will make a copy of the tests to test the -fno-tree-vectorize scenario(the
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
on 2021/10/13 下午2:29, Hongtao Liu via Gcc-patches wrote: > On Wed, Oct 13, 2021 at 11:34 AM Hongtao Liu wrote: >> >> On Tue, Oct 12, 2021 at 11:49 PM Martin Sebor wrote: >>> >>> On 10/11/21 8:31 PM, Hongtao Liu wrote: On Tue, Oct 12, 2021 at 4:08 AM Martin Sebor via Gcc-patches wrote: > > On 10/11/21 11:43 AM, Segher Boessenkool wrote: >> On Mon, Oct 11, 2021 at 10:23:03AM -0600, Martin Sebor wrote: >>> On 10/11/21 9:30 AM, Segher Boessenkool wrote: On Mon, Oct 11, 2021 at 10:47:00AM +0800, Kewen.Lin wrote: > - For generic test cases, it follows the existing suggested > practice with necessary target/xfail selector. Not such a great choice. Many of those tests do not make sense with vectorisation enabled. This should have been thought about, in some cases resulting in not running the test with vectorisation enabled, and in some cases duplicating the test, once with and once without vectorisation. >>> >>> The tests detect bugs that are present both with and without >>> vetctorization, so they should pass both ways. >> >> Then it should be tested both ways! This is my point. > > Agreed. (Most warnings are tested with just one set of options, > but it's becoming apparent that the middle end ones should be > exercised more extensively.) > >> >>> That they don't >>> tells us that that the warnings need work (they were written with >>> an assumption that doesn't hold anymore). >> >> They were written in world A. In world B many things behave >> differently. Transplanting the testcases from A to B without any extra >> analysis will not test what the testcases wanted to test, and possibly >> nothing at all anymore. > > Absolutely. > >> >>> We need to track that >>> work somehow, but simply xfailing them without making a record >>> of what underlying problem the xfails correspond to isn't the best >>> way. In my experience, what works well is opening a bug for each >>> distinct limitation (if one doesn't already exist) and adding >>> a reference to it as a comment to the xfail. >> >> Probably, yes. >> But you are just following established practice, so :-) >> >> I also am okay with this. If it was decided x86 does not have to deal >> with these (generic!) problems, then why should we do other people's >> work? > > I don't know that anything was decided. I think those changes > were made in haste, and (as you noted in your review of these > updates to them), were incomplete (missing comments referencing > the underlying bugs or limitations). Now that we've noticed it > we should try to fix it. I'm not expecting you (or Kwen) to do > other people's work, but it would help to let them/us know that > there is work for us to do. I only noticed the problem by luck. > > - struct A1 a = { 0, { 1 } }; // { dg-warning > "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } > + struct A1 a = { 0, { 1 } }; // { dg-warning > "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* > powerpc*-*-* > } } } >>> >>> As I mentioned in the bug, when adding xfails for regressions >>> please be sure to reference the bug that tracks the underlying >>> root cause.] >> >> You are saying this to whoever added that x86 xfail I hope. > > In general it's an appeal to both authors and reviewers of such > changes. Here, it's mostly for Hongtao who apparently added all > these undocumented xfails. > >>> There may be multiple problems, and we need to >>> identify what it is in each instance. As the author of >>> the tests I can help with that but not if I'm not in the loop >>> on these changes (it would seem prudent to get the author's >>> thoughts on such sweeping changes to their work). >> >> Yup. >> >>> I discussed one of these failures with Hongtao in detail at >>> the time autovectorization was being enabled and made the same >>> request then but I didn't realize the problem was so pervasive. >>> >>> In addition, the target-specific conditionals in the xfails are >>> going to be difficult to maintain. >> >> It is a cop-out. Especially because it makes no comment why it is >> xfailed (which should *always* be explained!) >> >>> It might be okay for one or >>> two in a single test but for so many we need a better solution >>> than that. If autovectorization is only enabled for a subset >>> of targets then a solution might be to add a new DejagGNU test >>> for it and conditionalize the xfails on it. >> >> That, combined with duplicating these tests and still testing the >> -fno-vectorization situation properly. Those tests
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On Wed, Oct 13, 2021 at 11:34 AM Hongtao Liu wrote: > > On Tue, Oct 12, 2021 at 11:49 PM Martin Sebor wrote: > > > > On 10/11/21 8:31 PM, Hongtao Liu wrote: > > > On Tue, Oct 12, 2021 at 4:08 AM Martin Sebor via Gcc-patches > > > wrote: > > >> > > >> On 10/11/21 11:43 AM, Segher Boessenkool wrote: > > >>> On Mon, Oct 11, 2021 at 10:23:03AM -0600, Martin Sebor wrote: > > On 10/11/21 9:30 AM, Segher Boessenkool wrote: > > > On Mon, Oct 11, 2021 at 10:47:00AM +0800, Kewen.Lin wrote: > > >> - For generic test cases, it follows the existing suggested > > >> practice with necessary target/xfail selector. > > > > > > Not such a great choice. Many of those tests do not make sense with > > > vectorisation enabled. This should have been thought about, in some > > > cases resulting in not running the test with vectorisation enabled, > > > and > > > in some cases duplicating the test, once with and once without > > > vectorisation. > > > > The tests detect bugs that are present both with and without > > vetctorization, so they should pass both ways. > > >>> > > >>> Then it should be tested both ways! This is my point. > > >> > > >> Agreed. (Most warnings are tested with just one set of options, > > >> but it's becoming apparent that the middle end ones should be > > >> exercised more extensively.) > > >> > > >>> > > That they don't > > tells us that that the warnings need work (they were written with > > an assumption that doesn't hold anymore). > > >>> > > >>> They were written in world A. In world B many things behave > > >>> differently. Transplanting the testcases from A to B without any extra > > >>> analysis will not test what the testcases wanted to test, and possibly > > >>> nothing at all anymore. > > >> > > >> Absolutely. > > >> > > >>> > > We need to track that > > work somehow, but simply xfailing them without making a record > > of what underlying problem the xfails correspond to isn't the best > > way. In my experience, what works well is opening a bug for each > > distinct limitation (if one doesn't already exist) and adding > > a reference to it as a comment to the xfail. > > >>> > > >>> Probably, yes. > > >>> > > > But you are just following established practice, so :-) > > >>> > > >>> I also am okay with this. If it was decided x86 does not have to deal > > >>> with these (generic!) problems, then why should we do other people's > > >>> work? > > >> > > >> I don't know that anything was decided. I think those changes > > >> were made in haste, and (as you noted in your review of these > > >> updates to them), were incomplete (missing comments referencing > > >> the underlying bugs or limitations). Now that we've noticed it > > >> we should try to fix it. I'm not expecting you (or Kwen) to do > > >> other people's work, but it would help to let them/us know that > > >> there is work for us to do. I only noticed the problem by luck. > > >> > > >> - struct A1 a = { 0, { 1 } }; // { dg-warning > > >> "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } > > >> + struct A1 a = { 0, { 1 } }; // { dg-warning > > >> "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* > > >> powerpc*-*-* > > >> } } } > > > > As I mentioned in the bug, when adding xfails for regressions > > please be sure to reference the bug that tracks the underlying > > root cause.] > > >>> > > >>> You are saying this to whoever added that x86 xfail I hope. > > >> > > >> In general it's an appeal to both authors and reviewers of such > > >> changes. Here, it's mostly for Hongtao who apparently added all > > >> these undocumented xfails. > > >> > > There may be multiple problems, and we need to > > identify what it is in each instance. As the author of > > the tests I can help with that but not if I'm not in the loop > > on these changes (it would seem prudent to get the author's > > thoughts on such sweeping changes to their work). > > >>> > > >>> Yup. > > >>> > > I discussed one of these failures with Hongtao in detail at > > the time autovectorization was being enabled and made the same > > request then but I didn't realize the problem was so pervasive. > > > > In addition, the target-specific conditionals in the xfails are > > going to be difficult to maintain. > > >>> > > >>> It is a cop-out. Especially because it makes no comment why it is > > >>> xfailed (which should *always* be explained!) > > >>> > > It might be okay for one or > > two in a single test but for so many we need a better solution > > than that. If autovectorization is only enabled for a subset > > of targets then a solution might be to add a new DejagGNU test > > for it and conditionalize the xfails on it. > > >>> > > >>> That, combined with duplicating these tests and still testing the > >
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On Tue, Oct 12, 2021 at 11:49 PM Martin Sebor wrote: > > On 10/11/21 8:31 PM, Hongtao Liu wrote: > > On Tue, Oct 12, 2021 at 4:08 AM Martin Sebor via Gcc-patches > > wrote: > >> > >> On 10/11/21 11:43 AM, Segher Boessenkool wrote: > >>> On Mon, Oct 11, 2021 at 10:23:03AM -0600, Martin Sebor wrote: > On 10/11/21 9:30 AM, Segher Boessenkool wrote: > > On Mon, Oct 11, 2021 at 10:47:00AM +0800, Kewen.Lin wrote: > >> - For generic test cases, it follows the existing suggested > >> practice with necessary target/xfail selector. > > > > Not such a great choice. Many of those tests do not make sense with > > vectorisation enabled. This should have been thought about, in some > > cases resulting in not running the test with vectorisation enabled, and > > in some cases duplicating the test, once with and once without > > vectorisation. > > The tests detect bugs that are present both with and without > vetctorization, so they should pass both ways. > >>> > >>> Then it should be tested both ways! This is my point. > >> > >> Agreed. (Most warnings are tested with just one set of options, > >> but it's becoming apparent that the middle end ones should be > >> exercised more extensively.) > >> > >>> > That they don't > tells us that that the warnings need work (they were written with > an assumption that doesn't hold anymore). > >>> > >>> They were written in world A. In world B many things behave > >>> differently. Transplanting the testcases from A to B without any extra > >>> analysis will not test what the testcases wanted to test, and possibly > >>> nothing at all anymore. > >> > >> Absolutely. > >> > >>> > We need to track that > work somehow, but simply xfailing them without making a record > of what underlying problem the xfails correspond to isn't the best > way. In my experience, what works well is opening a bug for each > distinct limitation (if one doesn't already exist) and adding > a reference to it as a comment to the xfail. > >>> > >>> Probably, yes. > >>> > > But you are just following established practice, so :-) > >>> > >>> I also am okay with this. If it was decided x86 does not have to deal > >>> with these (generic!) problems, then why should we do other people's > >>> work? > >> > >> I don't know that anything was decided. I think those changes > >> were made in haste, and (as you noted in your review of these > >> updates to them), were incomplete (missing comments referencing > >> the underlying bugs or limitations). Now that we've noticed it > >> we should try to fix it. I'm not expecting you (or Kwen) to do > >> other people's work, but it would help to let them/us know that > >> there is work for us to do. I only noticed the problem by luck. > >> > >> - struct A1 a = { 0, { 1 } }; // { dg-warning > >> "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } > >> + struct A1 a = { 0, { 1 } }; // { dg-warning > >> "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* > >> powerpc*-*-* > >> } } } > > As I mentioned in the bug, when adding xfails for regressions > please be sure to reference the bug that tracks the underlying > root cause.] > >>> > >>> You are saying this to whoever added that x86 xfail I hope. > >> > >> In general it's an appeal to both authors and reviewers of such > >> changes. Here, it's mostly for Hongtao who apparently added all > >> these undocumented xfails. > >> > There may be multiple problems, and we need to > identify what it is in each instance. As the author of > the tests I can help with that but not if I'm not in the loop > on these changes (it would seem prudent to get the author's > thoughts on such sweeping changes to their work). > >>> > >>> Yup. > >>> > I discussed one of these failures with Hongtao in detail at > the time autovectorization was being enabled and made the same > request then but I didn't realize the problem was so pervasive. > > In addition, the target-specific conditionals in the xfails are > going to be difficult to maintain. > >>> > >>> It is a cop-out. Especially because it makes no comment why it is > >>> xfailed (which should *always* be explained!) > >>> > It might be okay for one or > two in a single test but for so many we need a better solution > than that. If autovectorization is only enabled for a subset > of targets then a solution might be to add a new DejagGNU test > for it and conditionalize the xfails on it. > >>> > >>> That, combined with duplicating these tests and still testing the > >>> -fno-vectorization situation properly. Those tests tested something. > >>> With vectorisation enabled they might no longer test that same thing, > >>> especially if the test fails now! > >> > >> Right. The original autovectorization change was made either > >> without a full
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On Mon, Oct 11, 2021 at 02:07:49PM -0600, Martin Sebor wrote: > On 10/11/21 11:43 AM, Segher Boessenkool wrote: > >I also am okay with this. If it was decided x86 does not have to deal > >with these (generic!) problems, then why should we do other people's > >work? > > I don't know that anything was decided. It was approved though :-) I don't know all history behind it. > I think those changes > were made in haste, and (as you noted in your review of these > updates to them), were incomplete (missing comments referencing > the underlying bugs or limitations). Yeah. > Now that we've noticed it > we should try to fix it. I'm not expecting you (or Kwen) to do > other people's work, but it would help to let them/us know that > there is work for us to do. I only noticed the problem by luck. There is still a month of stage 1 to go, and we are getting >50 new fails every day. Maybe once that dies down we can report anything :-( Segher
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On Tue, Oct 12, 2021 at 11:15:51AM -0600, Martin Sebor wrote: > On 10/12/21 10:18 AM, Segher Boessenkool wrote: > >On Tue, Oct 12, 2021 at 09:49:19AM -0600, Martin Sebor wrote: > >>Coming back to the xfail conditionals, do you think you'll > >>be able to put together some target-supports magic so they > >>don't have to enumerate all the affected targets? > > > >There should only be an xfail if we do not expect to be able to fix the > >bug causing this any time soon. There shouldn't be one here, not yet > >anyway. > > > >Other than that: yes, and one you have such a selector, just dg-require > >it (or its inverse) for this test, don't xfail the test (if this is > >expected and correct behaviour). > > My sense is that fixing all the fallout from the vectorization > change is going to be delicate and time-consuming work. With > the end of stage 1 just about a month away I'm not too optimistic > how much of it I'll be able to get it done before then. Depending > on how intrusive the fixes turn out to be it may or may not be > suitable in stage 3. Some it will be suitable for stage4, even (testsuite-only changes for example). > Based on pr102706 that Jeff reported for the regressions in his > automated tester, it also sounds like the test failures are spread > out across a multitude of targets. In addition, it doesn't look > like the targets are all the same in all the tests. Enumerating > the targets that correspond to each test failure would be like > playing the proverbial Whac-A-Mole. > > That makes me think we do need some such selector rather soon. Yes. > The failing test cases are a subset of all the cases exercised > by the tests. We don't want to conditionally enable/disable > the whole tests just for the few failing cases (if that's what > you were suggesting by dg-require). I mean that the tests should not be done on targets where those tests do not make sense. > So we need to apply > the selector to individual dg-warning and dg-bogus directives > in these tests. Some of those tests should not be run with -fvectorize at all, imo. You *want* to limit things a lot, for detail tests. Segher
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On 10/12/2021 11:15 AM, Martin Sebor via Gcc-patches wrote: On 10/12/21 10:18 AM, Segher Boessenkool wrote: Hi! On Tue, Oct 12, 2021 at 09:49:19AM -0600, Martin Sebor wrote: Coming back to the xfail conditionals, do you think you'll be able to put together some target-supports magic so they don't have to enumerate all the affected targets? There should only be an xfail if we do not expect to be able to fix the bug causing this any time soon. There shouldn't be one here, not yet anyway. Other than that: yes, and one you have such a selector, just dg-require it (or its inverse) for this test, don't xfail the test (if this is expected and correct behaviour). My sense is that fixing all the fallout from the vectorization change is going to be delicate and time-consuming work. With the end of stage 1 just about a month away I'm not too optimistic how much of it I'll be able to get it done before then. Depending on how intrusive the fixes turn out to be it may or may not be suitable in stage 3. Based on pr102706 that Jeff reported for the regressions in his automated tester, it also sounds like the test failures are spread out across a multitude of targets. In addition, it doesn't look like the targets are all the same in all the tests. Enumerating the targets that correspond to each test failure would be like playing the proverbial Whac-A-Mole. There'll be some degree of whac-a-mole. But it likely isn't every target. I'm still evaluating that when I have a few minutes to look at a given target. jeff
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On 10/12/21 10:18 AM, Segher Boessenkool wrote: Hi! On Tue, Oct 12, 2021 at 09:49:19AM -0600, Martin Sebor wrote: Coming back to the xfail conditionals, do you think you'll be able to put together some target-supports magic so they don't have to enumerate all the affected targets? There should only be an xfail if we do not expect to be able to fix the bug causing this any time soon. There shouldn't be one here, not yet anyway. Other than that: yes, and one you have such a selector, just dg-require it (or its inverse) for this test, don't xfail the test (if this is expected and correct behaviour). My sense is that fixing all the fallout from the vectorization change is going to be delicate and time-consuming work. With the end of stage 1 just about a month away I'm not too optimistic how much of it I'll be able to get it done before then. Depending on how intrusive the fixes turn out to be it may or may not be suitable in stage 3. Based on pr102706 that Jeff reported for the regressions in his automated tester, it also sounds like the test failures are spread out across a multitude of targets. In addition, it doesn't look like the targets are all the same in all the tests. Enumerating the targets that correspond to each test failure would be like playing the proverbial Whac-A-Mole. That makes me think we do need some such selector rather soon. The failing test cases are a subset of all the cases exercised by the tests. We don't want to conditionally enable/disable the whole tests just for the few failing cases (if that's what you were suggesting by dg-require). So we need to apply the selector to individual dg-warning and dg-bogus directives in these tests. Martin
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
Hi! On Tue, Oct 12, 2021 at 09:49:19AM -0600, Martin Sebor wrote: > Coming back to the xfail conditionals, do you think you'll > be able to put together some target-supports magic so they > don't have to enumerate all the affected targets? There should only be an xfail if we do not expect to be able to fix the bug causing this any time soon. There shouldn't be one here, not yet anyway. Other than that: yes, and one you have such a selector, just dg-require it (or its inverse) for this test, don't xfail the test (if this is expected and correct behaviour). Segher
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On 10/11/21 8:31 PM, Hongtao Liu wrote: On Tue, Oct 12, 2021 at 4:08 AM Martin Sebor via Gcc-patches wrote: On 10/11/21 11:43 AM, Segher Boessenkool wrote: On Mon, Oct 11, 2021 at 10:23:03AM -0600, Martin Sebor wrote: On 10/11/21 9:30 AM, Segher Boessenkool wrote: On Mon, Oct 11, 2021 at 10:47:00AM +0800, Kewen.Lin wrote: - For generic test cases, it follows the existing suggested practice with necessary target/xfail selector. Not such a great choice. Many of those tests do not make sense with vectorisation enabled. This should have been thought about, in some cases resulting in not running the test with vectorisation enabled, and in some cases duplicating the test, once with and once without vectorisation. The tests detect bugs that are present both with and without vetctorization, so they should pass both ways. Then it should be tested both ways! This is my point. Agreed. (Most warnings are tested with just one set of options, but it's becoming apparent that the middle end ones should be exercised more extensively.) That they don't tells us that that the warnings need work (they were written with an assumption that doesn't hold anymore). They were written in world A. In world B many things behave differently. Transplanting the testcases from A to B without any extra analysis will not test what the testcases wanted to test, and possibly nothing at all anymore. Absolutely. We need to track that work somehow, but simply xfailing them without making a record of what underlying problem the xfails correspond to isn't the best way. In my experience, what works well is opening a bug for each distinct limitation (if one doesn't already exist) and adding a reference to it as a comment to the xfail. Probably, yes. But you are just following established practice, so :-) I also am okay with this. If it was decided x86 does not have to deal with these (generic!) problems, then why should we do other people's work? I don't know that anything was decided. I think those changes were made in haste, and (as you noted in your review of these updates to them), were incomplete (missing comments referencing the underlying bugs or limitations). Now that we've noticed it we should try to fix it. I'm not expecting you (or Kwen) to do other people's work, but it would help to let them/us know that there is work for us to do. I only noticed the problem by luck. - struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } + struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } As I mentioned in the bug, when adding xfails for regressions please be sure to reference the bug that tracks the underlying root cause.] You are saying this to whoever added that x86 xfail I hope. In general it's an appeal to both authors and reviewers of such changes. Here, it's mostly for Hongtao who apparently added all these undocumented xfails. There may be multiple problems, and we need to identify what it is in each instance. As the author of the tests I can help with that but not if I'm not in the loop on these changes (it would seem prudent to get the author's thoughts on such sweeping changes to their work). Yup. I discussed one of these failures with Hongtao in detail at the time autovectorization was being enabled and made the same request then but I didn't realize the problem was so pervasive. In addition, the target-specific conditionals in the xfails are going to be difficult to maintain. It is a cop-out. Especially because it makes no comment why it is xfailed (which should *always* be explained!) It might be okay for one or two in a single test but for so many we need a better solution than that. If autovectorization is only enabled for a subset of targets then a solution might be to add a new DejagGNU test for it and conditionalize the xfails on it. That, combined with duplicating these tests and still testing the -fno-vectorization situation properly. Those tests tested something. With vectorisation enabled they might no longer test that same thing, especially if the test fails now! Right. The original autovectorization change was made either without a full analysis of its impact on the affected warnings, or its impact wasn't adequately captured (either in the xfails comments or by opening bugs for them). Now that we know about this we should try to fix it. The first step toward that is to review the xfailed test cases and for each add a comment with the bug that captures its root cause. Hongtao, please let me know if you are going to work on that. I will make a copy of the tests to test the -fno-tree-vectorize scenario(the original test). For the xfails, they're analyzed and recorded in pr102462/pr102697, sorry for not adding comments to them. Thanks for raising pr102697! It captures the essence of the bug that's masked by the
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On Tue, Oct 12, 2021 at 4:08 AM Martin Sebor via Gcc-patches wrote: > > On 10/11/21 11:43 AM, Segher Boessenkool wrote: > > On Mon, Oct 11, 2021 at 10:23:03AM -0600, Martin Sebor wrote: > >> On 10/11/21 9:30 AM, Segher Boessenkool wrote: > >>> On Mon, Oct 11, 2021 at 10:47:00AM +0800, Kewen.Lin wrote: > - For generic test cases, it follows the existing suggested > practice with necessary target/xfail selector. > >>> > >>> Not such a great choice. Many of those tests do not make sense with > >>> vectorisation enabled. This should have been thought about, in some > >>> cases resulting in not running the test with vectorisation enabled, and > >>> in some cases duplicating the test, once with and once without > >>> vectorisation. > >> > >> The tests detect bugs that are present both with and without > >> vetctorization, so they should pass both ways. > > > > Then it should be tested both ways! This is my point. > > Agreed. (Most warnings are tested with just one set of options, > but it's becoming apparent that the middle end ones should be > exercised more extensively.) > > > > >> That they don't > >> tells us that that the warnings need work (they were written with > >> an assumption that doesn't hold anymore). > > > > They were written in world A. In world B many things behave > > differently. Transplanting the testcases from A to B without any extra > > analysis will not test what the testcases wanted to test, and possibly > > nothing at all anymore. > > Absolutely. > > > > >> We need to track that > >> work somehow, but simply xfailing them without making a record > >> of what underlying problem the xfails correspond to isn't the best > >> way. In my experience, what works well is opening a bug for each > >> distinct limitation (if one doesn't already exist) and adding > >> a reference to it as a comment to the xfail. > > > > Probably, yes. > > > >>> But you are just following established practice, so :-) > > > > I also am okay with this. If it was decided x86 does not have to deal > > with these (generic!) problems, then why should we do other people's > > work? > > I don't know that anything was decided. I think those changes > were made in haste, and (as you noted in your review of these > updates to them), were incomplete (missing comments referencing > the underlying bugs or limitations). Now that we've noticed it > we should try to fix it. I'm not expecting you (or Kwen) to do > other people's work, but it would help to let them/us know that > there is work for us to do. I only noticed the problem by luck. > > - struct A1 a = { 0, { 1 } }; // { dg-warning > "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } > + struct A1 a = { 0, { 1 } }; // { dg-warning > "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* powerpc*-*-* > } } } > >> > >> As I mentioned in the bug, when adding xfails for regressions > >> please be sure to reference the bug that tracks the underlying > >> root cause.] > > > > You are saying this to whoever added that x86 xfail I hope. > > In general it's an appeal to both authors and reviewers of such > changes. Here, it's mostly for Hongtao who apparently added all > these undocumented xfails. > > >> There may be multiple problems, and we need to > >> identify what it is in each instance. As the author of > >> the tests I can help with that but not if I'm not in the loop > >> on these changes (it would seem prudent to get the author's > >> thoughts on such sweeping changes to their work). > > > > Yup. > > > >> I discussed one of these failures with Hongtao in detail at > >> the time autovectorization was being enabled and made the same > >> request then but I didn't realize the problem was so pervasive. > >> > >> In addition, the target-specific conditionals in the xfails are > >> going to be difficult to maintain. > > > > It is a cop-out. Especially because it makes no comment why it is > > xfailed (which should *always* be explained!) > > > >> It might be okay for one or > >> two in a single test but for so many we need a better solution > >> than that. If autovectorization is only enabled for a subset > >> of targets then a solution might be to add a new DejagGNU test > >> for it and conditionalize the xfails on it. > > > > That, combined with duplicating these tests and still testing the > > -fno-vectorization situation properly. Those tests tested something. > > With vectorisation enabled they might no longer test that same thing, > > especially if the test fails now! > > Right. The original autovectorization change was made either > without a full analysis of its impact on the affected warnings, > or its impact wasn't adequately captured (either in the xfails > comments or by opening bugs for them). Now that we know about > this we should try to fix it. The first step toward that is > to review the xfailed test cases and for each add a comment with > the bug that captures its root cause. > >
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On 10/11/21 11:43 AM, Segher Boessenkool wrote: On Mon, Oct 11, 2021 at 10:23:03AM -0600, Martin Sebor wrote: On 10/11/21 9:30 AM, Segher Boessenkool wrote: On Mon, Oct 11, 2021 at 10:47:00AM +0800, Kewen.Lin wrote: - For generic test cases, it follows the existing suggested practice with necessary target/xfail selector. Not such a great choice. Many of those tests do not make sense with vectorisation enabled. This should have been thought about, in some cases resulting in not running the test with vectorisation enabled, and in some cases duplicating the test, once with and once without vectorisation. The tests detect bugs that are present both with and without vetctorization, so they should pass both ways. Then it should be tested both ways! This is my point. Agreed. (Most warnings are tested with just one set of options, but it's becoming apparent that the middle end ones should be exercised more extensively.) That they don't tells us that that the warnings need work (they were written with an assumption that doesn't hold anymore). They were written in world A. In world B many things behave differently. Transplanting the testcases from A to B without any extra analysis will not test what the testcases wanted to test, and possibly nothing at all anymore. Absolutely. We need to track that work somehow, but simply xfailing them without making a record of what underlying problem the xfails correspond to isn't the best way. In my experience, what works well is opening a bug for each distinct limitation (if one doesn't already exist) and adding a reference to it as a comment to the xfail. Probably, yes. But you are just following established practice, so :-) I also am okay with this. If it was decided x86 does not have to deal with these (generic!) problems, then why should we do other people's work? I don't know that anything was decided. I think those changes were made in haste, and (as you noted in your review of these updates to them), were incomplete (missing comments referencing the underlying bugs or limitations). Now that we've noticed it we should try to fix it. I'm not expecting you (or Kwen) to do other people's work, but it would help to let them/us know that there is work for us to do. I only noticed the problem by luck. - struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } + struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } As I mentioned in the bug, when adding xfails for regressions please be sure to reference the bug that tracks the underlying root cause.] You are saying this to whoever added that x86 xfail I hope. In general it's an appeal to both authors and reviewers of such changes. Here, it's mostly for Hongtao who apparently added all these undocumented xfails. There may be multiple problems, and we need to identify what it is in each instance. As the author of the tests I can help with that but not if I'm not in the loop on these changes (it would seem prudent to get the author's thoughts on such sweeping changes to their work). Yup. I discussed one of these failures with Hongtao in detail at the time autovectorization was being enabled and made the same request then but I didn't realize the problem was so pervasive. In addition, the target-specific conditionals in the xfails are going to be difficult to maintain. It is a cop-out. Especially because it makes no comment why it is xfailed (which should *always* be explained!) It might be okay for one or two in a single test but for so many we need a better solution than that. If autovectorization is only enabled for a subset of targets then a solution might be to add a new DejagGNU test for it and conditionalize the xfails on it. That, combined with duplicating these tests and still testing the -fno-vectorization situation properly. Those tests tested something. With vectorisation enabled they might no longer test that same thing, especially if the test fails now! Right. The original autovectorization change was made either without a full analysis of its impact on the affected warnings, or its impact wasn't adequately captured (either in the xfails comments or by opening bugs for them). Now that we know about this we should try to fix it. The first step toward that is to review the xfailed test cases and for each add a comment with the bug that captures its root cause. Hongtao, please let me know if you are going to work on that. Martin
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On Mon, Oct 11, 2021 at 10:23:03AM -0600, Martin Sebor wrote: > On 10/11/21 9:30 AM, Segher Boessenkool wrote: > >On Mon, Oct 11, 2021 at 10:47:00AM +0800, Kewen.Lin wrote: > >>- For generic test cases, it follows the existing suggested > >>practice with necessary target/xfail selector. > > > >Not such a great choice. Many of those tests do not make sense with > >vectorisation enabled. This should have been thought about, in some > >cases resulting in not running the test with vectorisation enabled, and > >in some cases duplicating the test, once with and once without > >vectorisation. > > The tests detect bugs that are present both with and without > vetctorization, so they should pass both ways. Then it should be tested both ways! This is my point. > That they don't > tells us that that the warnings need work (they were written with > an assumption that doesn't hold anymore). They were written in world A. In world B many things behave differently. Transplanting the testcases from A to B without any extra analysis will not test what the testcases wanted to test, and possibly nothing at all anymore. > We need to track that > work somehow, but simply xfailing them without making a record > of what underlying problem the xfails correspond to isn't the best > way. In my experience, what works well is opening a bug for each > distinct limitation (if one doesn't already exist) and adding > a reference to it as a comment to the xfail. Probably, yes. > >But you are just following established practice, so :-) I also am okay with this. If it was decided x86 does not have to deal with these (generic!) problems, then why should we do other people's work? > >>- struct A1 a = { 0, { 1 } }; // { dg-warning > >>"\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } > >>+ struct A1 a = { 0, { 1 } }; // { dg-warning > >>"\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* powerpc*-*-* > >>} } } > > As I mentioned in the bug, when adding xfails for regressions > please be sure to reference the bug that tracks the underlying > root cause.] You are saying this to whoever added that x86 xfail I hope. > There may be multiple problems, and we need to > identify what it is in each instance. As the author of > the tests I can help with that but not if I'm not in the loop > on these changes (it would seem prudent to get the author's > thoughts on such sweeping changes to their work). Yup. > I discussed one of these failures with Hongtao in detail at > the time autovectorization was being enabled and made the same > request then but I didn't realize the problem was so pervasive. > > In addition, the target-specific conditionals in the xfails are > going to be difficult to maintain. It is a cop-out. Especially because it makes no comment why it is xfailed (which should *always* be explained!) > It might be okay for one or > two in a single test but for so many we need a better solution > than that. If autovectorization is only enabled for a subset > of targets then a solution might be to add a new DejagGNU test > for it and conditionalize the xfails on it. That, combined with duplicating these tests and still testing the -fno-vectorization situation properly. Those tests tested something. With vectorisation enabled they might no longer test that same thing, especially if the test fails now! Thanks, Segher
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
On 10/11/21 9:30 AM, Segher Boessenkool wrote: Hi! On Mon, Oct 11, 2021 at 10:47:00AM +0800, Kewen.Lin wrote: As PR102658 shows, commit r12-4240 enables vectorization at O2, some cases need to be adjusted accordingly for rs6000 port. - For target specific test cases, this adds -fno-tree-vectorize to retain original test points, otherwise vectorization can make some expected scalar instructions gone or generate some unexpected instructions for vector construction. Ah good choice. - For generic test cases, it follows the existing suggested practice with necessary target/xfail selector. Not such a great choice. Many of those tests do not make sense with vectorisation enabled. This should have been thought about, in some cases resulting in not running the test with vectorisation enabled, and in some cases duplicating the test, once with and once without vectorisation. The tests detect bugs that are present both with and without vetctorization, so they should pass both ways. That they don't tells us that that the warnings need work (they were written with an assumption that doesn't hold anymore). We need to track that work somehow, but simply xfailing them without making a record of what underlying problem the xfails correspond to isn't the best way. In my experience, what works well is opening a bug for each distinct limitation (if one doesn't already exist) and adding a reference to it as a comment to the xfail. But you are just following established practice, so :-) - struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } + struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } As I mentioned in the bug, when adding xfails for regressions please be sure to reference the bug that tracks the underlying root cause. There may be multiple problems, and we need to identify what it is in each instance. As the author of the tests I can help with that but not if I'm not in the loop on these changes (it would seem prudent to get the author's thoughts on such sweeping changes to their work). I discussed one of these failures with Hongtao in detail at the time autovectorization was being enabled and made the same request then but I didn't realize the problem was so pervasive. In addition, the target-specific conditionals in the xfails are going to be difficult to maintain. It might be okay for one or two in a single test but for so many we need a better solution than that. If autovectorization is only enabled for a subset of targets then a solution might be to add a new DejagGNU test for it and conditionalize the xfails on it. Martin I don't know if powerpc*-*-* is the correct choice in all these cases. Sometimes it might have to be powerpc*-*-linux* or similar. We'll find out :-) (An xfail causes XPASS if the test does *not* fail). +/* Now O2 enables vectorization by default, which generates unexpected float + conversion for vector construction, so simply disable it. */ It is good to see these comments. I love puzzles, but not in the testsuite! :-) Okay for trunk. Thanks! Segher
Re: [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
Hi! On Mon, Oct 11, 2021 at 10:47:00AM +0800, Kewen.Lin wrote: > As PR102658 shows, commit r12-4240 enables vectorization at O2, > some cases need to be adjusted accordingly for rs6000 port. > > - For target specific test cases, this adds -fno-tree-vectorize > to retain original test points, otherwise vectorization can > make some expected scalar instructions gone or generate some > unexpected instructions for vector construction. Ah good choice. > - For generic test cases, it follows the existing suggested > practice with necessary target/xfail selector. Not such a great choice. Many of those tests do not make sense with vectorisation enabled. This should have been thought about, in some cases resulting in not running the test with vectorisation enabled, and in some cases duplicating the test, once with and once without vectorisation. But you are just following established practice, so :-) > - struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" > { target { i?86-*-* x86_64-*-* } } } > + struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" > { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } I don't know if powerpc*-*-* is the correct choice in all these cases. Sometimes it might have to be powerpc*-*-linux* or similar. We'll find out :-) (An xfail causes XPASS if the test does *not* fail). > +/* Now O2 enables vectorization by default, which generates unexpected float > + conversion for vector construction, so simply disable it. */ It is good to see these comments. I love puzzles, but not in the testsuite! :-) Okay for trunk. Thanks! Segher
[PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658]
Hi, As PR102658 shows, commit r12-4240 enables vectorization at O2, some cases need to be adjusted accordingly for rs6000 port. - For target specific test cases, this adds -fno-tree-vectorize to retain original test points, otherwise vectorization can make some expected scalar instructions gone or generate some unexpected instructions for vector construction. - For generic test cases, it follows the existing suggested practice with necessary target/xfail selector. Tested with expected results on powerpc64le-linux-gnu and powerpc64-linux-gnu. Is it ok for trunk? BR, Kewen - gcc/testsuite/ChangeLog: PR testsuite/102658 * c-c++-common/Wstringop-overflow-2.c: Adjust for rs6000 port. * g++.dg/warn/Wuninitialized-13.C: Likewise. * gcc.dg/Warray-parameter-3.c: Likewise. * gcc.dg/Wstringop-overflow-21.c: Likewise. * gcc.dg/Wstringop-overflow-68.c: Likewise. * gcc.dg/Wstringop-overflow-76.c: Likewise. * gcc.target/powerpc/dform-1.c: Adjust as vectorization enabled at O2. * gcc.target/powerpc/dform-2.c: Likewise. * gcc.target/powerpc/pr80510-2.c: Likewise. --- diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c index 7d29b5f48c7..5d83caddc4e 100644 --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c @@ -221,10 +221,10 @@ void ga1_1 (void) a1_1.a[1] = 1;// { dg-warning "\\\[-Wstringop-overflow" } a1_1.a[2] = 2;// { dg-warning "\\\[-Wstringop-overflow" } - struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } + struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } a.a[0] = 0; - a.a[1] = 1; // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } } - a.a[2] = 2; // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } } + a.a[1] = 1; // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* powerpc*-*-* } } } + a.a[2] = 2; // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* powerpc*-*-* } } } sink (); } @@ -320,10 +320,10 @@ void ga1i_1 (void) a1i_1.a[1] = 1; // { dg-warning "\\\[-Wstringop-overflow" } a1i_1.a[2] = 2; // { dg-warning "\\\[-Wstringop-overflow" } - struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } + struct A1 a = { 0, { 1 } }; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } a.a[0] = 1; - a.a[1] = 2; // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } } - a.a[2] = 3; // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } } + a.a[1] = 2; // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* powerpc*-*-* } } } + a.a[2] = 3; // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* powerpc*-*-* } } } sink (); } diff --git a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C index 210e74c3c3b..4ad897a6486 100644 --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C @@ -5,7 +5,7 @@ struct shared_count { shared_count () { } shared_count (shared_count ) -: pi (r.pi) { } // { dg-warning "\\\[-Wuninitialized" "" { xfail { i?86-*-* x86_64-*-* } } } +: pi (r.pi) { } // { dg-warning "\\\[-Wuninitialized" "" { xfail { i?86-*-* x86_64-*-* powerpc*-*-* } } } int pi; }; diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c index e8a269c85c6..f7404be8742 100644 --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c @@ -77,7 +77,7 @@ gia3 (int a[3]) __attribute__ ((noipa)) void gcas3 (char a[static 3]) { - a[0] = 0; a[1] = 1; a[2] = 2; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* } } } + a[0] = 0; a[1] = 1; a[2] = 2; // { dg-warning "\\\[-Wstringop-overflow" "" { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } a[3] = 3; // { dg-warning "\\\[-Warray-bounds" } } diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c index d88bde9c740..2db6a52b22b 100644 --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c @@ -23,10 +23,10 @@ void test_store_zero_length (int i) { char a[3]; struct S0 *p = (struct S0*)a; - p->a = 0; // { dg-warning "\\\[-Wstringop-overflow"