Fix for ppc-stackalign-1.c test

Ben Elliston bje@au1.ibm.com
Wed Oct 13 07:37:00 GMT 2004


This test has been failing for a while on powerpc-linux.  The failure
appears to have been introduced by the following change to c-decl.c to
enhance pedwarns:

2004-09-11  Joseph S. Myers  <jsm@polyomino.org.uk>

	* c-tree.h (enum c_storage_class): New.
	(struct c_declspecs): Add storage_class, inline_p and thread_p.
	* c-decl.c (shadow_tag_warned): Give errors for "inline" in empty
	declarations and "auto" or "register" in file scope empty
	declarations.  Give more specific warnings for other cases of
	storage class specifiers in empty declarations.
	(grokdeclarator): Update for new structures.  Don't check for
	multiple storage classes.  Diagnose file-scope "register" if
	pedantic.
	(build_null_declspecs): Update.
	(declspecs_add_scspec): Update.  Diagnose multiple storage class
	specifiers and invalid uses of "__thread".

This patch makes -pedantic-errors happy again and the test now passes.
Okay for mainline?

2004-10-13  Ben Elliston  <bje@au.ibm.com>

	* gcc.dg/ppc-stackalign-1.c: Move declaration for `sp' register
	variable to within the scope of g() to avoid a pendatic error.
	Also use __asm__ ("sp") instead of __asm__ ("r1").

*** ppc-stackalign-1.c.~1.1.~	Wed Oct 29 08:13:39 2003
--- ppc-stackalign-1.c	Wed Oct 13 16:41:45 2004
***************
*** 7,16 ****
  extern void abort (void);
  extern void exit (int);
  
- register unsigned long sp __asm__ ("r1");
- 
  void g (int * val __attribute__ ((unused)))
  {
    if (sp & 0xf)
      abort ();
  }
--- 7,16 ----
  extern void abort (void);
  extern void exit (int);
  
  void g (int * val __attribute__ ((unused)))
  {
+   register unsigned long sp __asm__ ("sp");
+ 
    if (sp & 0xf)
      abort ();
  }



More information about the Gcc-patches mailing list