]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
spu.h (C_COMMON_OVERRIDE_OPTIONS): Define.
authorBen Elliston <bje@gcc.gnu.org>
Wed, 13 Dec 2006 05:25:57 +0000 (16:25 +1100)
committerBen Elliston <bje@gcc.gnu.org>
Wed, 13 Dec 2006 05:25:57 +0000 (16:25 +1100)
* config/spu/spu.h (C_COMMON_OVERRIDE_OPTIONS): Define.
(REGISTER_TARGET_PRAGMAS): Don't zero warn_main flag.
* config/spu/spu-protos.h (spu_c_common_override_options):
Declare.
* config/spu/spu-c.c (spu_c_common_override_options): New.
* config/spu/spu.c (spu_override_options): Whitespace fix.

testsuite/
* gcc.target/spu/Wmain.c: New test.

From-SVN: r119817

gcc/ChangeLog
gcc/config/spu/spu-c.c
gcc/config/spu/spu-protos.h
gcc/config/spu/spu.c
gcc/config/spu/spu.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/spu/Wmain.c [new file with mode: 0644]

index 9914f2de487e1afb29b232720f2cfc7b89e24e61..0c159c8128232d1820d189441ea1aeb3f32bf219 100644 (file)
@@ -1,3 +1,13 @@
+2006-12-13  Sa Liu  <saliu@de.ibm.com>
+           Ben Elliston  <bje@au.ibm.com>
+
+       * config/spu/spu.h (C_COMMON_OVERRIDE_OPTIONS): Define.
+       (REGISTER_TARGET_PRAGMAS): Don't zero warn_main flag.
+       * config/spu/spu-protos.h (spu_c_common_override_options):
+       Declare.
+       * config/spu/spu-c.c (spu_c_common_override_options): New.
+       * config/spu/spu.c (spu_override_options): Whitespace fix.
+
 2006-12-12  Trevor Smigiel  <trevor_smigiel@playstation.sony.com>
 
        * config/spu/spu.c (cpat_info): Fix an incorrectly identified case.
index d52d5242c7ff2d6b573c478266d0f29e46f0304c..43d5d16b82578dec6dc58662aeea2c6d9f824b53 100644 (file)
@@ -141,3 +141,12 @@ spu_cpu_cpp_builtins (struct cpp_reader *pfile)
   builtin_define_std ("__vector=__attribute__((__spu_vector__))");
 }
 
+void
+spu_c_common_override_options (void)
+{ 
+  if (!TARGET_STD_MAIN)
+    {
+      /* Don't give warnings about the main() function.  */
+      warn_main = 0;
+    }
+}
index 710c833746ae54aa99fcb61be2f79cde7021fb15..01f5c60c887cad8f61666d9702b1d412f73e7613 100644 (file)
@@ -24,6 +24,7 @@ extern enum machine_mode spu_eh_return_filter_mode (void);
 extern void spu_cpu_cpp_builtins (struct cpp_reader * pfile);
 extern void builtin_define_std (const char *);
 extern void spu_override_options (void);
+extern void spu_c_common_override_options (void);
 extern int valid_subreg (rtx op);
 extern void spu_expand_extv (rtx * ops, int unsignedp);
 extern void spu_expand_insv (rtx * ops);
index 52b21e2e72a8b05a6979b513c8881897f9252086..7317da70afbd0de0e1c173754badbf5a6631694d 100644 (file)
@@ -257,7 +257,6 @@ struct gcc_target targetm = TARGET_INITIALIZER;
 void
 spu_override_options (void)
 {
-
   /* Override some of the default param values.  With so many registers
      larger values are better for these params.  */
   if (MAX_UNROLLED_INSNS == 100)
index 813bc6c039b57d4111ae01a765f96103a0e78f5e..5dc88fb8ee3d47f76cd410c5114ac1595ea5ffd1 100644 (file)
@@ -22,6 +22,7 @@
 #define TARGET_VERSION fprintf (stderr, " (spu %s)", __DATE__);
 
 #define OVERRIDE_OPTIONS spu_override_options()
+#define C_COMMON_OVERRIDE_OPTIONS spu_c_common_override_options()
 
 extern int target_flags;
 extern const char *spu_fixed_range_string;
@@ -242,8 +243,6 @@ enum reg_class {
 
 #define REGISTER_TARGET_PRAGMAS() do {                                 \
 targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin;   \
-  /* Don't give warnings about the main() function. */                 \
-warn_main = 0;                                                         \
 }while (0);
 
 \f
index b42ce26993f1ca32c04fdb973a9a06f9851c4c67..6f8978106decc168ff3eef17e7cadefc439b8b45 100644 (file)
@@ -1,3 +1,7 @@
+2006-12-13  Ben Elliston  <bje@au.ibm.com>
+
+       * gcc.target/spu/Wmain.c: New test.
+
 2006-12-12  Josh Conner  <jconner@apple.com>
 
        * g++.dg/abi/thunk3.C: Use .weak_definition on darwin.
diff --git a/gcc/testsuite/gcc.target/spu/Wmain.c b/gcc/testsuite/gcc.target/spu/Wmain.c
new file mode 100644 (file)
index 0000000..530c03f
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-Wmain -mstdmain" } */
+
+int main (void *wrong)
+{ /* { dg-warning "first argument of 'main' should be 'int'" "" } */
+  /* { dg-warning "'main' takes only zero or two arguments" "" { target *-*-* } 5 } */
+}