mirror of
https://github.com/pret/agbcc.git
synced 2026-04-24 23:10:04 -05:00
unnecessary push/pop fix
This commit is contained in:
parent
1d6e89930d
commit
60a72a15b8
|
|
@ -454,3 +454,6 @@ extern int flag_hex_asm;
|
|||
/* Nonzero if generated DWARF debug info should match (buggy) original
|
||||
GCC 2.95.x behavior. */
|
||||
extern int flag_legacy_debug_info;
|
||||
|
||||
/* Nonzero if prologue bug should be fixed. */
|
||||
extern int flag_prologue_bugfix;
|
||||
|
|
|
|||
|
|
@ -717,8 +717,11 @@ far_jump_used_p()
|
|||
rtx insn;
|
||||
|
||||
#ifndef OLD_COMPILER
|
||||
if (current_function_has_far_jump)
|
||||
return 1;
|
||||
if (!flag_prologue_bugfix)
|
||||
{
|
||||
if (current_function_has_far_jump)
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (insn = get_insns(); insn; insn = NEXT_INSN(insn))
|
||||
|
|
|
|||
10
gcc/toplev.c
10
gcc/toplev.c
|
|
@ -588,6 +588,9 @@ int flag_hex_asm = 0;
|
|||
/* Use old (buggy) DWARF line info generator. */
|
||||
int flag_legacy_debug_info = 0;
|
||||
|
||||
/* Fix prologue bug in new compiler. */
|
||||
int flag_prologue_bugfix = 0;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *string;
|
||||
|
|
@ -729,6 +732,13 @@ lang_independent_options f_options[] =
|
|||
"Use hex instead of decimal in assembly output"},
|
||||
{"legacy-debug-line-info", &flag_legacy_debug_info, 1,
|
||||
"Generate old (buggy) DWARF line info"},
|
||||
#ifndef OLD_COMPILER
|
||||
/* This flag fixes a bug in the newer agbcc version that causes `lr` to be
|
||||
saved onto the stack in functions where it is not necessary. This is
|
||||
needed to produce matching code for certain GBA games. */
|
||||
{"prologue-bugfix", &flag_prologue_bugfix, 1,
|
||||
"Prevent unnecessary saving of the lr register to the stack"},
|
||||
#endif
|
||||
};
|
||||
|
||||
#define NUM_ELEM(a) (sizeof (a) / sizeof ((a)[0]))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user