On Mon Jun 15, 2026 at 11:26 PM WEST, David Malcolm wrote:
> On Mon, 2026-06-15 at 20:26 +0100, Egas Ribeiro wrote:
>> On Mon Jun 15, 2026 at 5:10 PM WEST, David Malcolm wrote:
>> > On Sun, 2026-06-14 at 19:45 +0100, Egas Ribeiro wrote:
>> > > The following test (exception-subclass-2.C) xfails 
>> > 
>> > When you say it "xfails", do you mean that it continues to fail, or
>> > that it is now unexpectedly succeeding?
>> > 
>> It continues to fail because there doesn't seem to be any output
>> coming
>> from the line of the caller function, so there is no output to catch
>> from the testsuite.
>
> That's weird.  Is there any output coming from the
> __analyzer_dump_path?
>
with the following test:
```
#include "../../gcc.dg/analyzer/analyzer-decls.h"

class exception
{
};

class io_error : public exception
{
};

int __analyzer_inner ()
{
  try {
    throw io_error();
  } catch (exception &exc) {
    __analyzer_dump_path (); // { dg-message "path" }
    return -1;
  }
  __analyzer_dump_path (); // { dg-bogus "path" }
  return 0;
}

int test ()
{
  return __analyzer_inner (); // { dg-message "path" "PR analyzer/119697" { 
xfail *-*-* } }
}
```
we get:
```
/home/riogu/gcc-dev/source1/gcc/testsuite/g++.dg/analyzer/exception-subclass-2.C:
 In function ‘int __analyzer_inner()’:
/home/riogu/gcc-dev/source1/gcc/testsuite/g++.dg/analyzer/exception-subclass-2.C:16:26:
 note: path
   16 |     __analyzer_dump_path (); // { dg-message "path" }
      |     ~~~~~~~~~~~~~~~~~~~~~^~
  ‘int test()’: events 1-2
    │
    │   23 | int test ()
    │      |     ^~~~
    │      |     |
    │      |     (1) entry to ‘test’
    │   24 | {
    │   25 |   return __analyzer_inner (); // { dg-message "path" "PR 
analyzer/119697" { xfail *-*-* } }
    │      |          ~~~~~~~~~~~~~~~~~~~
    │      |                           |
    │      |                           (2) calling ‘__analyzer_inner’ from 
‘test’
    │
    └──> ‘int __analyzer_inner()’: events 3-6
           │
           │   11 | int __analyzer_inner ()
           │      |     ^~~~~~~~~~~~~~~~
           │      |     |
           │      |     (3) entry to ‘__analyzer_inner’
           │......
           │   14 |     throw io_error();
           │      |                    ~
           │      |                    |
           │      |                    (4) throwing exception of type 
‘io_error’ here...
           │   15 |   } catch (exception &exc) {
           │      |                       ~~~
           │      |                       |
           │      |                       (5) ...catching exception of type 
‘io_error’ here
           │   16 |     __analyzer_dump_path (); // { dg-message "path" }
           │      |     ~~~~~~~~~~~~~~~~~~~~~~~
           │      |                          |
           │      |                          (6) ⚠️  here
           │
```
Maybe I missunderstood how the analyzer is meant to work when it comes
to dumps, but I would expect the dump to not show up on the line:
```
  return __analyzer_inner (); // { dg-message "path" "PR analyzer/119697" { 
xfail *-*-* } }
```
at all. There isn't really anything to dump, is there? Maybe we would
want to do __analyzer_eval (__analyzer_inner () == -1)? Or does the
analyzer somehow dump something from the call? Let me know how it is
meant to work here.

>> but only now we do the calls interprocedurally. if thats OK then I'll
>> include the added __analyzer_dump_path in a new version of the patch,
>> otherwise maybe the test is redundant.
>
> I think the fact that it's interprocedural is probably enough for it to
> be worth keeping the test.
>
Ok.

>> Should I submit a patch later with the fixed docs or do you want to
>> do
>> that? I don't have commit access so someone would have to push it for
>> me.
>
> Please submit a patch.
>
Ok.

Thanks,
Egas

Reply via email to