On Thu, Nov 21, 2013 at 3:31 PM, Steven Bosscher <stevenb....@gmail.com> wrote: > On Thu, Nov 21, 2013 at 8:57 PM, Teresa Johnson wrote: >> There are two problems I am fixing here (see >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59233 for full analysis). >> >> The first is the original ICE in crossjump optimization, which was >> exposed by enabling -freorder-blocks-and-partition which was >> conservatively preventing some upstream block combining optimizations. >> The issue is that the block ended in a NOTE_INSN_DELETED, which >> old_insns_match_p could not handle. I am fixing this by passing >> old_insns_match_p the last instruction in the block that it knows how >> to handle. >> >> The second issue this exposed was that we were unnecessarily marking >> landing pad branches EDGE_PRESERVE since >> flag_reorder_blocks_and_partition was on, even though this was -Os and >> we will gate partitioning off. > > So we keep an edge to a landing pad... Why is this a problem?
It just seems silly to limit optimization unnecessarily when we can deduce that we won't actually attempt partitioning. > > >> * bb-reorder.c (do_partition_blocks): New function. >> (gate_handle_partition_blocks): Call do_partition_blocks. >> * bb-reorder.h (do_partition_blocks): Declare. >> * except.c (dw2_build_landing_pads): Call do_partition_blocks. > > Exporting this gate function from bb-reorder.c shouldn't be necessary. > Better fix this at the root, in except.c. How would we do that? I didn't want to clone the logic that determines whether we will partition, so I thought outlining the checks from the gate function and exporting them would be cleaner. But I am open to suggestions. > > >> * cfgcleanup.c (outgoing_edges_match): Walk up past note instructions >> not understood by old_insns_match_p. > > This part is OK. Ok, let me get this part in first, since it will address the ICE. Thanks, Teresa > > Ciao! > Steven -- Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413