diff mbox

ptx preliminary rtl patches [4/4]

Message ID 5411A337.7000302@codesourcery.com
State New
Headers show

Commit Message

Bernd Schmidt Sept. 11, 2014, 1:27 p.m. UTC
It turns out that we're calling eliminate_regs for global variables 
which can't possibly have eliminable regs in their decl. At that point, 
reg_eliminate can be NULL. This patch avoids unnecessary work, and 
allows us to add an assert to eliminate_regs later.

Bootstrapped and tested on x86_64-linux, together with the other 
patches.  Ok?


Bernd

Comments

Steven Bosscher Sept. 11, 2014, 3:58 p.m. UTC | #1
On Thu, Sep 11, 2014 at 3:27 PM, Bernd Schmidt wrote:
> It turns out that we're calling eliminate_regs for global variables which
> can't possibly have eliminable regs in their decl. At that point,
> reg_eliminate can be NULL. This patch avoids unnecessary work, and allows us
> to add an assert to eliminate_regs later.
>
> Bootstrapped and tested on x86_64-linux, together with the other patches.
> Ok?

Why not use is_global_var()?

Ciao!
Steven
Bernd Schmidt Oct. 29, 2014, 11:48 p.m. UTC | #2
On 09/11/2014 05:58 PM, Steven Bosscher wrote:
> On Thu, Sep 11, 2014 at 3:27 PM, Bernd Schmidt wrote:
>> It turns out that we're calling eliminate_regs for global variables which
>> can't possibly have eliminable regs in their decl. At that point,
>> reg_eliminate can be NULL. This patch avoids unnecessary work, and allows us
>> to add an assert to eliminate_regs later.
>>
>> Bootstrapped and tested on x86_64-linux, together with the other patches.
>> Ok?
>
> Why not use is_global_var()?

As discussed in a different subthread - that also works. Ok with that 
change?


Bernd
Jeff Law Oct. 30, 2014, 3:07 a.m. UTC | #3
On 10/29/14 17:48, Bernd Schmidt wrote:
> On 09/11/2014 05:58 PM, Steven Bosscher wrote:
>> On Thu, Sep 11, 2014 at 3:27 PM, Bernd Schmidt wrote:
>>> It turns out that we're calling eliminate_regs for global variables
>>> which
>>> can't possibly have eliminable regs in their decl. At that point,
>>> reg_eliminate can be NULL. This patch avoids unnecessary work, and
>>> allows us
>>> to add an assert to eliminate_regs later.
>>>
>>> Bootstrapped and tested on x86_64-linux, together with the other
>>> patches.
>>> Ok?
>>
>> Why not use is_global_var()?
>
> As discussed in a different subthread - that also works. Ok with that
> change?
Yes, assuming the usual bootstrap & regression testing shows now issues.

jeff
diff mbox

Patch

    	* dbxout.c (dbxout_symbol): Don't call eliminate_regs on TREE_STATIC
    	decls.

diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index d856bdd..ffef1f5 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -2887,7 +2887,8 @@  dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
       if (!decl_rtl)
 	DBXOUT_DECR_NESTING_AND_RETURN (0);
 
-      decl_rtl = eliminate_regs (decl_rtl, VOIDmode, NULL_RTX);
+      if (!TREE_STATIC (decl))
+	decl_rtl = eliminate_regs (decl_rtl, VOIDmode, NULL_RTX);
 #ifdef LEAF_REG_REMAP
       if (crtl->uses_only_leaf_regs)
 	leaf_renumber_regs_insn (decl_rtl);