diff options
author | Jeff Law <law@redhat.com> | 2013-02-08 13:03:52 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2013-02-08 13:03:52 -0700 |
commit | a698cc0308468029029e0501815747284194e407 (patch) | |
tree | a991da3f3350280432395c213f19731541c363b9 /gcc | |
parent | e1122ddda6332ca3a430b3944053ad8ecf11fb20 (diff) | |
download | gcc-a698cc0308468029029e0501815747284194e407.zip gcc-a698cc0308468029029e0501815747284194e407.tar.gz gcc-a698cc0308468029029e0501815747284194e407.tar.bz2 |
re PR debug/53948 (Assignment line missing for -O0 -g)
PR debug/53948
* emit-rtl.c (reg_is_parm_p): New function.
* regs.h (reg_is_parm_p): New prototype.
* ira-conflicts.c (ira_build_conflicts): Allow parameters in
callee-clobbered registers.
PR debug/53948
* gcc.dg/debug/dwarf2/pr53948.c: New test.
From-SVN: r195900
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 12 | ||||
-rw-r--r-- | gcc/ira-conflicts.c | 8 | ||||
-rw-r--r-- | gcc/regs.h | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c | 10 |
6 files changed, 43 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9d66888..2693b7e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-02-08 Jeff Law <law@redhat.com> + + PR debug/53948 + * emit-rtl.c (reg_is_parm_p): New function. + * regs.h (reg_is_parm_p): New prototype. + * ira-conflicts.c (ira_build_conflicts): Allow parameters in + callee-clobbered registers. + 2013-02-08 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/56043 diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index f997e5d..2c70fb1 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -919,6 +919,18 @@ gen_reg_rtx (enum machine_mode mode) return val; } +/* Return TRUE if REG is a PARM_DECL, FALSE otherwise. */ + +bool +reg_is_parm_p (rtx reg) +{ + tree decl; + + gcc_assert (REG_P (reg)); + decl = REG_EXPR (reg); + return (decl && TREE_CODE (decl) == PARM_DECL); +} + /* Update NEW with the same attributes as REG, but with OFFSET added to the REG_OFFSET. */ diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c index 711db0f..710986b0 100644 --- a/gcc/ira-conflicts.c +++ b/gcc/ira-conflicts.c @@ -895,8 +895,12 @@ ira_build_conflicts (void) if ((! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0) /* For debugging purposes don't put user defined variables in - callee-clobbered registers. */ - || (optimize == 0 && REG_USERVAR_P (allocno_reg))) + callee-clobbered registers. However, do allow parameters + in callee-clobbered registers to improve debugging. This + is a bit of a fragile hack. */ + || (optimize == 0 + && REG_USERVAR_P (allocno_reg) + && ! reg_is_parm_p (allocno_reg))) { IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), call_used_reg_set); @@ -89,6 +89,8 @@ REG_N_SETS (int regno) #define SET_REG_N_SETS(N,V) (regstat_n_sets_and_refs[N].sets = V) #define INC_REG_N_SETS(N,V) (regstat_n_sets_and_refs[N].sets += V) +/* Given a REG, return TRUE if the reg is a PARM_DECL, FALSE otherwise. */ +extern bool reg_is_parm_p (rtx); /* Functions defined in regstat.c. */ extern void regstat_init_n_sets_and_refs (void); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 583e7d5..83843b7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-02-08 Jeff Law <law@redhat.com> + + PR debug/53948 + * gcc.dg/debug/dwarf2/pr53948.c: New test. + 2013-02-08 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/56043 diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c new file mode 100644 index 0000000..f0600b7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c @@ -0,0 +1,10 @@ +/* Test that we have line information for the line + with local variable initializations. */ +/* { dg-options "-O0 -g -dA" } */ +/* { dg-final { scan-assembler ".loc 1 8 0|# line 8" } } */ + + +int f (register int a, register int b) { + register int x = b, y = a; + return x + y; } + |