public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH V4] RISC-V: Fix a redefinition bug for the fd-4.c
@ 2023-04-07  3:37 shiyulong
  2023-04-07  3:37 ` [PATCH V2] RISC-V: Modified validation information for contracts-tmpl-spec2.C shiyulong
  2023-04-08 18:46 ` [PATCH V4] RISC-V: Fix a redefinition bug for the fd-4.c Jeff Law
  0 siblings, 2 replies; 4+ messages in thread
From: shiyulong @ 2023-04-07  3:37 UTC (permalink / raw)
  To: gcc-patches
  Cc: palmer, kito.cheng, jim.wilson.gcc, wuwei2016, jiawei, shihua,
	dje.gcc, mirimmad, pinskia, jeffreyalaw, yulong

From: yulong <shiyulong@iscas.ac.cn>

This patch fix a redefinition bug.
There are have a definition about mode_t in the fd-4.c, but it duplicates the definition in types.h that be included by stdio.h.

gcc/testsuite/ChangeLog:

        * gcc.dg/analyzer/fd-4.c: delete the definition of mode_t.

---
 gcc/testsuite/gcc.dg/analyzer/fd-4.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-4.c b/gcc/testsuite/gcc.dg/analyzer/fd-4.c
index 994bad84342..9ec015679e9 100644
--- a/gcc/testsuite/gcc.dg/analyzer/fd-4.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-4.c
@@ -13,11 +13,6 @@ int read (int fd, void *buf, int nbytes);
 #define O_WRONLY 1
 #define O_RDWR 2
 
-typedef enum {
-  S_IRWXU
-  // etc
-} mode_t;
-
 int creat (const char *, mode_t mode);
 
 void
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH V2] RISC-V: Modified validation information for contracts-tmpl-spec2.C
  2023-04-07  3:37 [PATCH V4] RISC-V: Fix a redefinition bug for the fd-4.c shiyulong
@ 2023-04-07  3:37 ` shiyulong
  2023-04-28 21:53   ` Jeff Law
  2023-04-08 18:46 ` [PATCH V4] RISC-V: Fix a redefinition bug for the fd-4.c Jeff Law
  1 sibling, 1 reply; 4+ messages in thread
From: shiyulong @ 2023-04-07  3:37 UTC (permalink / raw)
  To: gcc-patches
  Cc: palmer, kito.cheng, jim.wilson.gcc, wuwei2016, jiawei, shihua,
	dje.gcc, mirimmad, pinskia, jeffreyalaw, yulong

From: yulong <shiyulong@iscas.ac.cn>

This patch fixes the problem of the contracts-tmpl-spec2.c running failure.
When run the dejagnu test, I find that the output is inconsistent with that verified
in the testcase. So I try to modify it, and then it can be passed.

gcc/testsuite/ChangeLog:

        * g++.dg/contracts/contracts-tmpl-spec2.C:delete some output information

---
 gcc/testsuite/g++.dg/contracts/contracts-tmpl-spec2.C | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/gcc/testsuite/g++.dg/contracts/contracts-tmpl-spec2.C b/gcc/testsuite/g++.dg/contracts/contracts-tmpl-spec2.C
index 82117671b2d..17048584ac9 100644
--- a/gcc/testsuite/g++.dg/contracts/contracts-tmpl-spec2.C
+++ b/gcc/testsuite/g++.dg/contracts/contracts-tmpl-spec2.C
@@ -369,15 +369,9 @@ int main(int, char**)
 // { dg-output {contract violation in function G3<int, double>::f at .*:148: s > 2(\n|\r\n|\r)} }
 // { dg-output {\[continue:on\](\n|\r\n|\r)} }
 // { dg-output {G3 full int double(\n|\r\n|\r)} }
-// { dg-output {contract violation in function G3<char, char>::f at .*:124: t > 0(\n|\r\n|\r)} }
-// { dg-output {\[continue:on\](\n|\r\n|\r)} }
-// { dg-output {contract violation in function G3<char, char>::f at .*:125: s > 0(\n|\r\n|\r)} }
-// { dg-output {\[continue:on\](\n|\r\n|\r)} }
 // { dg-output {G3 general T S(\n|\r\n|\r)} }
 // { dg-output {contract violation in function G3<int, char>::f at .*:139: t > 1(\n|\r\n|\r)} }
 // { dg-output {\[continue:on\](\n|\r\n|\r)} }
-// { dg-output {contract violation in function G3<int, char>::f at .*:140: s > 1(\n|\r\n|\r)} }
-// { dg-output {\[continue:on\](\n|\r\n|\r)} }
 // { dg-output {G3 partial int S(\n|\r\n|\r)} }
 // { dg-output {G3 full int C(\n|\r\n|\r)} }
 // { dg-output {G3 full int C(\n|\r\n|\r)} }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V4] RISC-V: Fix a redefinition bug for the fd-4.c
  2023-04-07  3:37 [PATCH V4] RISC-V: Fix a redefinition bug for the fd-4.c shiyulong
  2023-04-07  3:37 ` [PATCH V2] RISC-V: Modified validation information for contracts-tmpl-spec2.C shiyulong
@ 2023-04-08 18:46 ` Jeff Law
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Law @ 2023-04-08 18:46 UTC (permalink / raw)
  To: shiyulong, gcc-patches
  Cc: palmer, kito.cheng, jim.wilson.gcc, wuwei2016, jiawei, shihua,
	dje.gcc, mirimmad, pinskia, David Malcolm



On 4/6/23 21:37, shiyulong@iscas.ac.cn wrote:
> From: yulong <shiyulong@iscas.ac.cn>
> 
> This patch fix a redefinition bug.
> There are have a definition about mode_t in the fd-4.c, but it duplicates the definition in types.h that be included by stdio.h.
> 
> gcc/testsuite/ChangeLog:
> 
>          * gcc.dg/analyzer/fd-4.c: delete the definition of mode_t.
This may not be advisable.  I wouldn't be shocked to find out there are 
systems that do not provide mode_t.

Ultimately David Malcolm (on cc) should make the final decision here. 
It's really not a RISC-V problem.

jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] RISC-V: Modified validation information for contracts-tmpl-spec2.C
  2023-04-07  3:37 ` [PATCH V2] RISC-V: Modified validation information for contracts-tmpl-spec2.C shiyulong
@ 2023-04-28 21:53   ` Jeff Law
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2023-04-28 21:53 UTC (permalink / raw)
  To: shiyulong, gcc-patches
  Cc: palmer, kito.cheng, jim.wilson.gcc, wuwei2016, jiawei, shihua,
	dje.gcc, mirimmad, pinskia



On 4/6/23 21:37, shiyulong@iscas.ac.cn wrote:
> From: yulong <shiyulong@iscas.ac.cn>
> 
> This patch fixes the problem of the contracts-tmpl-spec2.c running failure.
> When run the dejagnu test, I find that the output is inconsistent with that verified
> in the testcase. So I try to modify it, and then it can be passed.
> 
> gcc/testsuite/ChangeLog:
> 
>          * g++.dg/contracts/contracts-tmpl-spec2.C:delete some output information
I think you need to debug why you get different output from this test. 
Just removing the output because it didn't match on risc-v seems wrong.

jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-28 21:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-07  3:37 [PATCH V4] RISC-V: Fix a redefinition bug for the fd-4.c shiyulong
2023-04-07  3:37 ` [PATCH V2] RISC-V: Modified validation information for contracts-tmpl-spec2.C shiyulong
2023-04-28 21:53   ` Jeff Law
2023-04-08 18:46 ` [PATCH V4] RISC-V: Fix a redefinition bug for the fd-4.c Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).