This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc/dependence.c problem on HP-UX 10.20


On 23 Aug 2000, Alexandre Oliva wrote:

> > Line 199 of gcc/dependence.c:
> > static void ziv_test PARAMS ((subscript[], subscript[],
> >   enum direction_type[][], int[][], loop*, int));
> 
> Yep, this is bogus.  Please try this patch.  I've only tested it with
> GCC, so I'd appreciate it if you could run it through the compiler
> that (correctly) rejects the code and let me know if the patch fixes
> all instances of the problem.

OK to commit the following testcase for GCC's failure to diagnose the
problem?  (Tree checking errors for the array of functions will cause an
XPASS and a FAIL.  I'll submit a PR.  Though - see the referenced DR -
diagnostics are only needed in C99, the behavior is undefined anyway and
it would in fact make little sense for the diagnostics to depend on the
standard version.)

2000-08-23  Joseph S. Myers  <jsm28@cam.ac.uk>

	* gcc.dg/c99-array-nonobj-1.c: New test.

--- /dev/null	Fri Sep 11 11:31:59 1998
+++ c99-array-nonobj-1.c	Wed Aug 23 20:08:31 2000
@@ -0,0 +1,27 @@
+/* Test for arrays of incomplete and function types: a constraint violation
+   in C99 only, though undefined (DR#047) before.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+typedef void func (void);
+struct s;
+
+extern int a[][]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "\[\]\[\] var" { xfail *-*-* } 11 } */
+
+void f (int [][]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "\[\]\[\] arg" { xfail *-*-* } 14 } */
+
+extern struct s b[]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "struct \[\] var" { xfail *-*-* } 17 } */
+
+void g (struct s []); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "struct \[\] arg" { xfail *-*-* } 20 } */
+
+extern func c[]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "func \[\] var" { xfail *-*-* } 23 } */
+
+void h (func []); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "func \[\] arg" { xfail *-*-* } 26 } */

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]