public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* Re: syntax errors in new SPARC files
@ 1998-08-18  8:09 Kaveh R. Ghazi
  1998-08-18  8:25 ` David S. Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Kaveh R. Ghazi @ 1998-08-18  8:09 UTC (permalink / raw)
  To: davem, jfc; +Cc: egcs-bugs, egcs-patches

	I got the following error on bootstrapping the egcs trunk
checked out today (19980818) on sparc-sun-solaris2.5 using cc for
stage 1.  Looks like another instance of the label stuff jfc found.

 > cc -c -DIN_GCC -DSVR4 -g -DHAVE_CONFIG_H -DHAIFA -I. -I. -I./config
 > 	./config/sparc/sparc.c
 > "./config/sparc/sparc.c", line 6406: syntax error before or at: }

	I fixed it with the following patch.

--- /caip/u26/ghazi/gcc-testing/cvs-egcs/egcs/gcc/config/sparc/sparc.c	Mon Aug 17 09:35:19 1998
+++ egcs-CVS19980818/gcc/config/sparc/sparc.c	Tue Aug 18 11:00:37 1998
@@ -6402,7 +6402,7 @@
 
 	  return &list[i];
 	}
-    next:
+    next:;
     }
   return 0;
 }
--
Kaveh R. Ghazi			Project Manager / Custom Development
ghazi@caip.rutgers.edu		Icon CMT Corp.


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

* Re: syntax errors in new SPARC files
  1998-08-18  8:09 syntax errors in new SPARC files Kaveh R. Ghazi
@ 1998-08-18  8:25 ` David S. Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David S. Miller @ 1998-08-18  8:25 UTC (permalink / raw)
  To: ghazi; +Cc: jfc, egcs-bugs, egcs-patches

   Date: Tue, 18 Aug 1998 11:09:39 -0400 (EDT)
   From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>

    > cc -c -DIN_GCC -DSVR4 -g -DHAVE_CONFIG_H -DHAIFA -I. -I. -I./config
    > 	./config/sparc/sparc.c
    > "./config/sparc/sparc.c", line 6406: syntax error before or at: }

	   I fixed it with the following patch.

Patch applied, I introduced it yesterday :-)  I still think this rule
in the C standard is silly and worthless and actually painful to silly
people like me. :-)

Later,
David S. Miller
davem@dm.cobaltmicro.com


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

* Re: syntax errors in new SPARC files
  1998-08-11 20:51 ` David S. Miller
  1998-08-12  1:00   ` Richard Henderson
@ 1998-08-12 13:54   ` John Carr
  1 sibling, 0 replies; 7+ messages in thread
From: John Carr @ 1998-08-12 13:54 UTC (permalink / raw)
  To: David S. Miller; +Cc: egcs-bugs

>    return with an expression in a function returning void is not allowed.
>    Neither is a label without a following statement.
> 
> Says who?  ANSI C?  The GNU coding standards?  Some broken C compiler
> out there?  Who?

K&R C, ANSI C, and C++ all agree that a label must be followed by a statement.
gcc, on request, will print this warning:

	ANSI C forbids label at end of compound statement

I can't find my K&R to quote the return requirement, but note the following
in c-typeck.c:

      if (pedantic || TREE_CODE (TREE_TYPE (retval)) != VOID_TYPE)
	pedwarn ("`return' with a value, in function returning void");

Sun's SPARC compiler reports errors in both cases.



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

* Re: syntax errors in new SPARC files
  1998-08-12  1:00   ` Richard Henderson
@ 1998-08-12  1:16     ` David S. Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David S. Miller @ 1998-08-12  1:16 UTC (permalink / raw)
  To: rth; +Cc: egcs-bugs, egcs-patches

   Date: Wed, 12 Aug 1998 01:00:04 -0700
   From: Richard Henderson <rth@dot.cygnus.com>

   On Tue, Aug 11, 1998 at 08:50:16PM -0700, David S. Miller wrote:
   > Says who?  ANSI C?

   Says ISO.  You should have, in fact, gotten a warning from GCC about
   them.  Why they were not declared an error I do not know.

Only when -ansi is specified right?  We've been using these constructs
in the Linux kernel for years and GCC still isn't complaining so I'm
guessing this is the case (that -ansi causes the warning).  Actually I
don't remember any warnings for this when bootstrapping the new sparc
rewrite code which has all warnings enabled...

Later,
David S. Miller
davem@dm.cobaltmicro.com


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

* Re: syntax errors in new SPARC files
  1998-08-11 20:51 ` David S. Miller
@ 1998-08-12  1:00   ` Richard Henderson
  1998-08-12  1:16     ` David S. Miller
  1998-08-12 13:54   ` John Carr
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Henderson @ 1998-08-12  1:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: egcs-bugs, egcs-patches

On Tue, Aug 11, 1998 at 08:50:16PM -0700, David S. Miller wrote:
>    return with an expression in a function returning void is not allowed.
>    Neither is a label without a following statement.
> 
> Says who?  ANSI C?

Says ISO.  You should have, in fact, gotten a warning from GCC about
them.  Why they were not declared an error I do not know.


r~


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

* Re: syntax errors in new SPARC files
  1998-08-11 14:42 John Carr
@ 1998-08-11 20:51 ` David S. Miller
  1998-08-12  1:00   ` Richard Henderson
  1998-08-12 13:54   ` John Carr
  0 siblings, 2 replies; 7+ messages in thread
From: David S. Miller @ 1998-08-11 20:51 UTC (permalink / raw)
  To: jfc; +Cc: egcs-bugs, egcs-patches

   From: John Carr <jfc@tiac.net>
   Date: Tue, 11 Aug 1998 16:03:17 EDT

   return with an expression in a function returning void is not allowed.
   Neither is a label without a following statement.

Says who?  ANSI C?  The GNU coding standards?  Some broken C compiler
out there?  Who?

Please please please please tell me (and I've asked you for this
before in private email) what C compilers do not accept these
constructs as they are.  I think it is very ugly when coded in this
way so I'd like to avoid the change if it isn't necessary.

Later,
David S. Miller
davem@dm.cobaltmicro.com


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

* syntax errors in new SPARC files
@ 1998-08-11 14:42 John Carr
  1998-08-11 20:51 ` David S. Miller
  0 siblings, 1 reply; 7+ messages in thread
From: John Carr @ 1998-08-11 14:42 UTC (permalink / raw)
  To: egcs-bugs, egcs-patches

return with an expression in a function returning void is not allowed.
Neither is a label without a following statement.

Tue Aug 11 16:01:29 1998  John Carr  <jfc@mit.edu>

	* sparc.c: Change return <exp> to <exp>; return; in functions
 	returning void.

*** sparc.c~	Tue Aug 11 10:53:07 1998
--- sparc.c	Tue Aug 11 14:27:29 1998
***************
*** 1586,1592 ****
  	temp = op0;
        else
  	temp = gen_reg_rtx (DImode);
!       return sparc_emit_set_symbolic_const64 (op0, op1, temp);
      }
  
    if (GET_CODE (op1) == CONST_DOUBLE)
--- 1586,1593 ----
  	temp = op0;
        else
  	temp = gen_reg_rtx (DImode);
!       sparc_emit_set_symbolic_const64 (op0, op1, temp);
!       return;
      }
  
    if (GET_CODE (op1) == CONST_DOUBLE)
***************
*** 1716,1723 ****
     */
    if (high_bits == 0
        || high_bits == 0xffffffff)
!     return sparc_emit_set_const64_quick1 (op0, temp, low_bits,
! 					  (high_bits == 0xffffffff));
  
    /* 1) sethi	%hi(high_bits), %reg
     *    or	%reg, %lo(high_bits), %reg
--- 1717,1727 ----
     */
    if (high_bits == 0
        || high_bits == 0xffffffff)
!     {
!       sparc_emit_set_const64_quick1 (op0, temp, low_bits,
! 				     (high_bits == 0xffffffff));
!       return;
!     }
  
    /* 1) sethi	%hi(high_bits), %reg
     *    or	%reg, %lo(high_bits), %reg
***************
*** 1726,1732 ****
    if (low_bits == 0
        || (SPARC_SIMM13_P(low_bits)
  	  && ((HOST_WIDE_INT)low_bits > 0)))
!     return sparc_emit_set_const64_quick2 (op0, temp, high_bits, low_bits, 32);
  
    /* Now, try 3-insn sequences.  But first we may be able to do something
       quick when the constant is negated, so try that.  */
--- 1730,1738 ----
    if (low_bits == 0
        || (SPARC_SIMM13_P(low_bits)
  	  && ((HOST_WIDE_INT)low_bits > 0)))
!     {
!       sparc_emit_set_const64_quick2 (op0, temp, high_bits, low_bits, 32);
!     }
  
    /* Now, try 3-insn sequences.  But first we may be able to do something
       quick when the constant is negated, so try that.  */
***************
*** 1788,1796 ****
        if (hi & lo)
  	abort();
        focus_bits = (hi | lo);
!       return sparc_emit_set_const64_quick2 (op0, temp,
! 					    focus_bits, 0,
! 					    lowest_bit_set);
      }
  
    /* The easiest way when all else fails, is full decomposition. */
--- 1794,1801 ----
        if (hi & lo)
  	abort();
        focus_bits = (hi | lo);
!       sparc_emit_set_const64_quick2 (op0, temp, focus_bits, 0, lowest_bit_set);
!       return;
      }
  
    /* The easiest way when all else fails, is full decomposition. */
*** sparc.md~	Tue Aug 11 10:53:46 1998
--- sparc.md	Tue Aug 11 14:24:11 1998
***************
*** 1933,1939 ****
  
    /* All QI constants require only one insn, so proceed.  */
  
!  movqi_is_ok:
  }")
  
  (define_insn "*movqi_insn"
--- 1933,1939 ----
  
    /* All QI constants require only one insn, so proceed.  */
  
!  movqi_is_ok:;
  }")
  
  (define_insn "*movqi_insn"
***************
*** 2001,2007 ****
        sparc_emit_set_const32 (operands[0], operands[1]);
        DONE;
      }
!  movhi_is_ok:
  }")
  
  (define_insn "*movhi_insn"
--- 2001,2007 ----
        sparc_emit_set_const32 (operands[0], operands[1]);
        DONE;
      }
!  movhi_is_ok:;
  }")
  
  (define_insn "*movhi_insn"
***************
*** 2105,2111 ****
        sparc_emit_set_const32 (operands[0], operands[1]);
        DONE;
      }
!  movsi_is_ok:
  }")
  
  ;; Special LIVE_G0 pattern to obtain zero in a register.
--- 2105,2111 ----
        sparc_emit_set_const32 (operands[0], operands[1]);
        DONE;
      }
!  movsi_is_ok:;
  }")
  
  ;; Special LIVE_G0 pattern to obtain zero in a register.
***************
*** 2289,2295 ****
        DONE;
      }
  
!  movdi_is_ok:
  }")
  
  ;; Be careful, fmovd does not exist when !arch64.
--- 2289,2295 ----
        DONE;
      }
  
!  movdi_is_ok:;
  }")
  
  ;; Be careful, fmovd does not exist when !arch64.
***************
*** 2763,2769 ****
  	}
      }
  
!  movsf_is_ok:
  }")
  
  (define_insn "*movsf_insn"
--- 2763,2769 ----
  	}
      }
  
!  movsf_is_ok:;
  }")
  
  (define_insn "*movsf_insn"
***************
*** 2848,2854 ****
  	}
      }
  
!  movdf_is_ok:
  }")
  
  ;; Be careful, fmovd does not exist when !arch64.
--- 2848,2854 ----
  	}
      }
  
!  movdf_is_ok:;
  }")
  
  ;; Be careful, fmovd does not exist when !arch64.
***************
*** 3072,3078 ****
  	}
      }
  
! movtf_is_ok:
  }")
  
  ;; Be careful, fmovq and {st,ld}{x,q} do not exist when !arch64 so
--- 3072,3078 ----
  	}
      }
  
! movtf_is_ok:;
  }")
  
  ;; Be careful, fmovq and {st,ld}{x,q} do not exist when !arch64 so


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

end of thread, other threads:[~1998-08-18  8:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-18  8:09 syntax errors in new SPARC files Kaveh R. Ghazi
1998-08-18  8:25 ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
1998-08-11 14:42 John Carr
1998-08-11 20:51 ` David S. Miller
1998-08-12  1:00   ` Richard Henderson
1998-08-12  1:16     ` David S. Miller
1998-08-12 13:54   ` John Carr

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).