diff options
Diffstat (limited to 'gcc-4.8/gcc/ira.c')
-rw-r--r-- | gcc-4.8/gcc/ira.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/ira.c b/gcc-4.8/gcc/ira.c index 9e16465e4..87e72f067 100644 --- a/gcc-4.8/gcc/ira.c +++ b/gcc-4.8/gcc/ira.c @@ -4742,6 +4742,18 @@ do_reload (void) if (need_dce && optimize) run_fast_dce (); + /* Diagnose uses of the hard frame pointer when it is used as a global + register. Often we can get away with letting the user appropriate + the frame pointer, but we should let them know when code generation + makes that impossible. */ + if (global_regs[HARD_FRAME_POINTER_REGNUM] && frame_pointer_needed) + { + tree decl = global_regs_decl[HARD_FRAME_POINTER_REGNUM]; + error_at (DECL_SOURCE_LOCATION (current_function_decl), + "frame pointer required, but reserved"); + inform (DECL_SOURCE_LOCATION (decl), "for %qD", decl); + } + timevar_pop (TV_IRA); } |