re PR debug/54694 (internal compiler error: in dwarf2out_frame_debug_expr, at dwarf2out.c:2387)

PR debug/54694

Diagnose frame_pointer_required vs fixed hfp

From-SVN: r206647
This commit is contained in:
Richard Henderson 2014-01-15 13:41:03 -08:00 committed by Richard Henderson
parent 4583fada2d
commit af6e846774
5 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2014-01-15 Richard Henderson <rth@redhat.com>
PR debug/54694
* reginfo.c (global_regs_decl): Globalize.
* rtl.h (global_regs_decl): Declare.
* ira.c (do_reload): Diagnose frame_pointer_needed and it
reserved via global_regs.
2014-01-15 Teresa Johnson <tejohnson@google.com>
* tree-ssa-sccvn.c (visit_reference_op_call): Handle NULL vdef.

View File

@ -5532,6 +5532,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);
}

View File

@ -86,7 +86,7 @@ static const char initial_call_really_used_regs[] = CALL_REALLY_USED_REGISTERS;
char global_regs[FIRST_PSEUDO_REGISTER];
/* Declaration for the global register. */
static tree GTY(()) global_regs_decl[FIRST_PSEUDO_REGISTER];
tree global_regs_decl[FIRST_PSEUDO_REGISTER];
/* Same information as REGS_INVALIDATED_BY_CALL but in regset form to be used
in dataflow more conveniently. */

View File

@ -2795,6 +2795,8 @@ extern void _fatal_insn (const char *, const_rtx, const char *, int, const char
#define fatal_insn_not_found(insn) \
_fatal_insn_not_found (insn, __FILE__, __LINE__, __FUNCTION__)
/* reginfo.c */
extern tree GTY(()) global_regs_decl[FIRST_PSEUDO_REGISTER];
#endif /* ! GCC_RTL_H */

View File

@ -0,0 +1,11 @@
/* { dg-do compile } */
/* { dg-options "-O" } */
register void *hfp __asm__("%ebp"); /* { dg-message "note: for" } */
extern void g(void *);
void f(int x) /* { dg-error "frame pointer required" } */
{
g(__builtin_alloca(x));
}