This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes


On 03/17/2016 12:23 PM, Bernd Schmidt wrote:
On 03/17/2016 06:37 PM, Jeff Law wrote:
+  bitmap seen_insns;

+  seen_insns = BITMAP_ALLOC (NULL);

You could save an allocation here by making this a bitmap_head and using
bitmap_initialize.
I guess so, but it's one allocation per compiled function and doesn't leak. Using bitmap_initialize would introduce a conditional in the loop

+      bitmap_set_bit (seen_insns, INSN_UID (insn));
+
       if (! INSN_P (insn))
     continue;

@@ -3646,7 +3656,8 @@ update_equiv_regs (void)
       && ! find_reg_note (XEXP (reg_equiv[regno].init_insns, 0),
                   REG_EQUIV, NULL_RTX)
       && ! contains_replace_regs (XEXP (dest, 0))
-      && ! pdx_subregs[regno])
+      && ! pdx_subregs[regno]
+      && ! bitmap_bit_p (seen_insns, INSN_UID (insn)))

This looks odd to me. Isn't this condition always false? Did you want to
test the init_insn?
You're right. Egad. Which indirectly argues that this code in and of itself needs some test coverage to verify that it fires when it's supposed to. So, I'm off to find & reduce a test where this code triggers correctly. :-)

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]