https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115448

            Bug ID: 115448
           Summary: Improvements to CFG edge visualization in diagnostic
                    paths
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

See https://godbolt.org/z/5e6d3Pvff (from bug 115436) where the path has:

    │
    └──> 'my_str_push_char': events 3-4
           │
           │   28 | static bool my_str_push_char(my_str* s, char c) {
           │      |             ^~~~~~~~~~~~~~~~
           │      |             |
           │      |             (3) entry to 'my_str_push_char'
           │   29 |   if (s->len >= s->cap) if (!my_str_realloc(s, s->cap * 2))
return false;
           │      |      ~       
           │      |      |
           │      |      (4) following 'true' branch... ─>─┐
           │      |                                        │
           │
         'my_str_push_char': event 5
           │
           │      |                                        │
           │      |┌───────────────────────────────────────┘
           │   29 |│  if (s->len >= s->cap) if (!my_str_realloc(s, s->cap * 2))
return false;
           │      |│                                               ~^~~~~
           │      |│                                                |
           │      |└───────────────────────────────────────────────>(5) ...to
here
           │
         'my_str_push_char': event 6
           │
           │   29 |   if (s->len >= s->cap) if (!my_str_realloc(s, s->cap * 2))
return false;
           │      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           │      |                              |
           │      |                              (6) calling 'my_str_realloc'
from 'my_str_push_char'
           │
           └──> 'my_str_realloc': events 7-13
                  │

If we supported "intraline" edges, then events 4 and 5 could probably be linked
like this (thus consolidating event 5 in with events 3-4):

    │
    └──> 'my_str_push_char': events 3-5
           │
           │   28 | static bool my_str_push_char(my_str* s, char c) {
           │      |             ^~~~~~~~~~~~~~~~
           │      |             |
           │      |             (3) entry to 'my_str_push_char'
           │   29 |   if (s->len >= s->cap) if (!my_str_realloc(s, s->cap * 2))
return false;
           │      |      ~                                         ~^~~~~
           │      |      |                                          | 
           │      |      (4) following 'true' branch... ───────────>(5) ...to
here       
           │
         'my_str_push_char': event 6
           │
           │   29 |   if (s->len >= s->cap) if (!my_str_realloc(s, s->cap * 2))
return false;
           │      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           │      |                              |
           │      |                              (6) calling 'my_str_realloc'
from 'my_str_push_char'
           │
           └──> 'my_str_realloc': events 7-13
                  │

Reply via email to