On 01/03/2018 01:54 PM, Jakub Jelinek wrote: > Hi! > > My recent dwarf2out.c, dbxout.c and rs6000.c uses of crtl->has_bb_partition > all assume that if it is true then the function actually has 2 partitions > and NOTE_INSN_SWITCH_SECTIONS is present, but as the following testcase > shows, that isn't always the case, crtl->has_bb_partition is set during > bbpart pass if there are 2 partitions, but there are many passes in between > and all bbs of one of the partitions could be optimized away. > > Are there any uses of this flag that would be interested in whether the > function had any partitions in the past (I guess that also means > BB_PARTITION is not unspecified), rather than whether the function has 2 > partitions right now? If yes, instead of this patch we could introduce > a new flag in cfun set by insert_section_boundary_note. If not, the > following patch should be sufficient. > > Bootstrapped/regtested on x86_64-linux and i686-linux. > > 2018-01-03 Jakub Jelinek <ja...@redhat.com> > > PR debug/83585 > * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition > to switched_sections. > > * gcc.dg/pr83585.c: New test. I don't think the question of whether or not there were partitions in the past is particularly interesting -- I could probably conjure up a need, but it wouldn't be based on any actual need I'm aware of.
Let's go with this until such time as a port really needs to answer that kind of question. jeff