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: using scratchpads to enhance RTL-level if-conversion: the new patch is almost ready to be prepared for merging to trunk, but not 100% ready yet



On 9/24/15 1:07 AM, Jeff Law wrote:

So what that means is the presence or absence of debug information is causing a difference in
> the code you generate.  That is (of course) bad and indicates a bug of some kind in your code.

I haven't put your code under a debugger or anything like that, but this does jump out:

+        rtx_insn* temp_src_insn = BB_HEAD (then_bb);
+        if (temp_src_insn && NOTE_INSN_BASIC_BLOCK_P (temp_src_insn))
+          temp_src_insn = NEXT_INSN (temp_src_insn); /* skip over a start-of-BB note */

What if BB_HEAD (then_bb) is a DEBUG_INSN with -g enabled, but is a NOTE_INSN_BASIC_BLOCK when -g is not enabled.  That could cause
this kind of failure.


Thanks very much! I`m just checking email right before heading out to surgery, so I can`t experiment on changing the above code right now, but I`ll be sure to do so next week.

After some thinking, I thought of this question: would "-g"/"-g3"/etc. cause a DEBUG_INSN to be present in the RTL as the first insn in the BB, just before the start-of-BB note? In other words, rather than only checking to see if I should skip copying the first insn in the BB, would checking {the first insn, and if that`s not a NOTE, then check the second insn} and skipping over whichever one is the first "hit" for "NOTE" be a safe strategy?

Thanks again!

Regards,

Abe



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