Skip to content

GCC behaviour difference (-mgpopt) #30

@mkst

Description

@mkst

This scratch shows different GCC behaviour between the PSYQ binary and our compiled one.

Other than the code difference, our version spits out the variables at the end of the file, rather than the start, which is caused by this diff (i.e. we want TARGET_FILE_SWITCHING to be true):

dezgeg commented:

aha, they have done some ugly hack:

--- gcc-2.8.1/config/mips/mips.h        1997-12-29 02:34:57.000000000 +0200
+++ GCC281S/config/mips/mips.h  2025-03-31 23:08:43.433889661 +0300
@@ -367,7 +367,11 @@
 /* This is true if we must enable the assembly language file switching
    code.  */

+/* GIL : This is an unpleasant way of enabling target file switching. */
+/*
 #define TARGET_FILE_SWITCHING  (TARGET_GP_OPT && ! TARGET_GAS)
+*/
+#define TARGET_FILE_SWITCHING   (TARGET_GP_OPT && TARGET_GAS)

 /* We must disable the function end stabs when doing the file switching trick,
    because the Lscope stabs end up in the wrong place, making it impossible
@@ -1255,7 +1259,12 @@
 #define POINTER_BOUNDARY (TARGET_LONG64 ? 64 : 32)

 /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
+/* GIL - Grim hack for N64 with -mgp64 - experimental for Richard Frankish */
+/* DAVE - this code was already in here.  why is limiting Allocation Boundary to 32 bits grim?
+/*
 #define PARM_BOUNDARY (TARGET_64BIT ? 64 : 32)
+*/
+#define PARM_BOUNDARY 32

 /* Allocation boundary (in *bits*) for the code of a function.  */
 #define FUNCTION_BOUNDARY 32

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions