diff mbox

Remove VMS_TARGET

Message ID CABu31nMUD8Bsg4r9XPSDuNmkbnU8-E8edq4j4JS=KOF58K2q3g@mail.gmail.com
State New
Headers show

Commit Message

Steven Bosscher June 18, 2012, 11:01 a.m. UTC
Hello,

There are exactly 2 references to the target macro VMS_TARGET:

cp/decl.c:#if VMS_TARGET
config/vax/vax.h:#define VMS_TARGET 0

I'm not sure what the macro is for. GCC seems to support a couple of
VMS targets, but none of them define VMS_TARGET.

This patch remove the macro. I can't test this because I have no
access to a VMS machine, but it is pretty obvious that the macro is
dead code.
OK for trunk?

Ciao!
Steven



gcc/
        * config/vax/vax.h (VMS_TARGET): Remove.

cp/
        * decl.c (finish_function): Remove code conditional on VMS_TARGET.

Comments

Joseph Myers June 18, 2012, 11:21 a.m. UTC | #1
On Mon, 18 Jun 2012, Steven Bosscher wrote:

> gcc/
>         * config/vax/vax.h (VMS_TARGET): Remove.
> 
> cp/
>         * decl.c (finish_function): Remove code conditional on VMS_TARGET.

OK.  Both C and C++ specify an implicit return of 0 from main; it's for 
the C runtime to convert return values from main into whatever form the 
underlying platform expects, rather than for the compiler to generate 
something different from what "return 0;" would do.
Tristan Gingold June 18, 2012, 11:40 a.m. UTC | #2
On Jun 18, 2012, at 1:01 PM, Steven Bosscher wrote:

> Hello,
> 
> There are exactly 2 references to the target macro VMS_TARGET:
> 
> cp/decl.c:#if VMS_TARGET
> config/vax/vax.h:#define VMS_TARGET 0
> 
> I'm not sure what the macro is for. GCC seems to support a couple of
> VMS targets, but none of them define VMS_TARGET.
> 
> This patch remove the macro. I can't test this because I have no
> access to a VMS machine, but it is pretty obvious that the macro is
> dead code.

The return code conversion is performed by vms-ucrt0.c and indeed this code is not used.

Tristan.
diff mbox

Patch

Index: config/vax/vax.h
===================================================================
--- config/vax/vax.h    (revision 188724)
+++ config/vax/vax.h    (working copy)
@@ -35,8 +35,6 @@  along with GCC; see the file COPYING3.  If not see
     }                                          \
   while (0)

-#define VMS_TARGET 0
-
 /* Use -J option for long branch support with Unix assembler.  */

 #define ASM_SPEC "-J"
Index: cp/decl.c
===================================================================
--- cp/decl.c   (revision 188724)
+++ cp/decl.c   (working copy)
@@ -13461,16 +13461,9 @@  finish_function (int flags)
      there's no need to add any extra bits.  */
   if (!DECL_CLONED_FUNCTION_P (fndecl))
     {
+      /* Make it so that `main' always returns 0 by default.  */
       if (DECL_MAIN_P (current_function_decl))
-       {
-         /* Make it so that `main' always returns 0 by default (or
-            1 for VMS).  */
-#if VMS_TARGET
-         finish_return_stmt (integer_one_node);
-#else
-         finish_return_stmt (integer_zero_node);
-#endif
-       }
+       finish_return_stmt (integer_zero_node);

       if (use_eh_spec_block (current_function_decl))
        finish_eh_spec_block (TYPE_RAISES_EXCEPTIONS