Bug #75405 [Asn->Fbk]: Redundant ext infos after optimizing

From: Date: Fri, 15 Oct 2021 17:57:45 +0000
Subject: Bug #75405 [Asn->Fbk]: Redundant ext infos after optimizing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237226@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75405&edit=1

 ID:                 75405
 Updated by:         cmb@php.net
 Reported by:        laruence@php.net
 Summary:            Redundant ext infos after optimizing
-Status:             Assigned
+Status:             Feedback
 Type:               Bug
 Package:            *General Issues
 PHP Version:        7.2.0RC4
 Assigned To:        laruence
 Block user comment: N
 Private report:     N

 New Comment:

PHP-7.4 with opcache.opt_debug_level=0x20000:

    foo: ; (lines=3, args=2, vars=2, tmps=0)
        ; (after optimizer)
        ; C:\php-sdk\phpdev\vc15\x64\75405.php:2-6
    L0 (2):     CV0($s1) = RECV 1
    L1 (2):     CV1($s2) = RECV 2
    L2 (5):     RETURN int(0)

Is there something left to do?

> […], especially when 7.3 comes around.

The good old days. ;)


Previous Comments:
------------------------------------------------------------------------
[2017-11-21 13:10:30] derick@php.net

Ping :-)

------------------------------------------------------------------------
[2017-11-10 17:16:03] derick@php.net

I would love for this to be resolved. By knowing that an oparray has been optimised (by reading a
flag), AND having the EXT_STMTs to end up on the logically right place. Otherwise, debugging
usability when opcache is enabled is going to be a very annoying affair, especially when 7.3 comes
around.

------------------------------------------------------------------------
[2017-11-06 22:43:52] derick@php.net

I know that, but from a user's point of view, that means that stopping *after* all these lines
makes more sense. Otherwise a debugger would stop before it looks to the user that following lines
(L3/L4) have been executed.

------------------------------------------------------------------------
[2017-10-21 05:21:06] laruence@php.net

but L3-L4 has been optimized out....

------------------------------------------------------------------------
[2017-10-19 09:18:00] derick@php.net

I would argue that the expected result should be this instead:

Expected result:
----------------
function name: foo
L2-6 foo() /tmp/1.php - 0x7f54cbdde2d0 + 5 ops
 L2    #0     EXT_NOP
 L2    #1     RECV                    1                                         $s1
 L2    #2     RECV                    2                                         $s2
 L5    #3     EXT_STMT
 L5    #4     RETURN                  0
[Script ended normally]

i.e., the EXT_STMT on line 5 instead of three, so that when the debugger stops the state of
variables is correct. If it would stop earlier, only some of the code looks like it has been run,
but the state of the variables looks like after more code (on future lines) have been run.

But then again, $x *never* gets set in the first place, so its value doesn't make it into the
symbol table that Xdebug can access to show its value.

Is there a way to find out whether $x has been optimised out? gdb does this as well, and I think
that would be more useful to have.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=75405


--
Edit this bug report at https://bugs.php.net/bug.php?id=75405&edit=1


Thread (8 messages)

« previous php.bugs (#237226) next »