Remove remaining traces of m_vecdata from comments [PR109006]

Message ID ZAMI/REWaNXGJPL2@tucnak
State Unresolved
Headers
Series Remove remaining traces of m_vecdata from comments [PR109006] |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Jakub Jelinek March 4, 2023, 9:01 a.m. UTC
  Hi!

The following patch adjusts remaining references to the removed m_vecdata
array from vec.h in various comments.

Tested on x86_64-linux, ok for trunk?

2023-03-04  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/109006
	* vec.cc (test_auto_alias): Adjust comment for removal of
	m_vecdata.
	* read-rtl-function.cc (function_reader::parse_block): Likewise.
	* gdbhooks.py: Likewise.


	Jakub
  

Comments

Richard Biener March 4, 2023, 10:22 a.m. UTC | #1
> Am 04.03.2023 um 10:02 schrieb Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org>:
> 
> Hi!
> 
> The following patch adjusts remaining references to the removed m_vecdata
> array from vec.h in various comments.
> 
> Tested on x86_64-linux, ok for trunk?

Ok 

Richard 

> 2023-03-04  Jakub Jelinek  <jakub@redhat.com>
> 
>    PR middle-end/109006
>    * vec.cc (test_auto_alias): Adjust comment for removal of
>    m_vecdata.
>    * read-rtl-function.cc (function_reader::parse_block): Likewise.
>    * gdbhooks.py: Likewise.
> 
> --- gcc/vec.cc.jj    2023-02-27 09:41:30.910265623 +0100
> +++ gcc/vec.cc    2023-03-03 13:00:01.941663049 +0100
> @@ -568,7 +568,7 @@ test_auto_delete_vec ()
>   ASSERT_EQ (dtor_count, 2);
> }
> 
> -/* Verify accesses to m_vecdata are done indirectly.  */
> +/* Verify accesses to vector elements are done indirectly.  */
> 
> static void
> test_auto_alias ()
> --- gcc/read-rtl-function.cc.jj    2023-01-02 09:32:54.001828467 +0100
> +++ gcc/read-rtl-function.cc    2023-03-03 12:59:15.941340372 +0100
> @@ -622,10 +622,11 @@ function_reader::parse_block ()
> 
>      These can get out-of-sync when basic blocks are optimized away.
>      They get back in sync by "compact_blocks".
> -     We reconstruct cfun->cfg->x_basic_block_info->m_vecdata with NULL
> -     values in it for any missing basic blocks, so that (a) == (b) for
> -     all of the blocks we create.  The doubly-linked list of basic
> -     blocks (next_bb/prev_bb) skips over these "holes".  */
> +     We reconstruct cfun->cfg->x_basic_block_info->address () pointed
> +     vector elements with NULL values in it for any missing basic blocks,
> +     so that (a) == (b) for all of the blocks we create.  The
> +     doubly-linked list of basic blocks (next_bb/prev_bb) skips over
> +     these "holes".  */
> 
>   if (m_highest_bb_idx < bb_idx)
>     m_highest_bb_idx = bb_idx;
> --- gcc/gdbhooks.py.jj    2023-03-03 17:48:45.255040248 +0100
> +++ gcc/gdbhooks.py    2023-03-03 18:42:06.609496428 +0100
> @@ -133,10 +133,10 @@ vector: attempting to do so instead give
> or a (probably) invalid cast to vec<> for the memory after the vec (for
> vec[1] onwards).
> 
> -Instead (for now) you must access m_vecdata:
> -  (gdb) p bb->preds->m_vecdata[0]
> +Instead (for now) you must access the payload directly:
> +  (gdb) p ((edge_def**)(bb->preds+1))[0]
>   $20 = <edge 0x7ffff044d380 (3 -> 5)>
> -  (gdb) p bb->preds->m_vecdata[1]
> +  (gdb) p ((edge_def**)(bb->preds+1))[1]
>   $21 = <edge 0x7ffff044d3b8 (4 -> 5)>
> """
> import os.path
> 
>    Jakub
>
  

Patch

--- gcc/vec.cc.jj	2023-02-27 09:41:30.910265623 +0100
+++ gcc/vec.cc	2023-03-03 13:00:01.941663049 +0100
@@ -568,7 +568,7 @@  test_auto_delete_vec ()
   ASSERT_EQ (dtor_count, 2);
 }
 
-/* Verify accesses to m_vecdata are done indirectly.  */
+/* Verify accesses to vector elements are done indirectly.  */
 
 static void
 test_auto_alias ()
--- gcc/read-rtl-function.cc.jj	2023-01-02 09:32:54.001828467 +0100
+++ gcc/read-rtl-function.cc	2023-03-03 12:59:15.941340372 +0100
@@ -622,10 +622,11 @@  function_reader::parse_block ()
 
      These can get out-of-sync when basic blocks are optimized away.
      They get back in sync by "compact_blocks".
-     We reconstruct cfun->cfg->x_basic_block_info->m_vecdata with NULL
-     values in it for any missing basic blocks, so that (a) == (b) for
-     all of the blocks we create.  The doubly-linked list of basic
-     blocks (next_bb/prev_bb) skips over these "holes".  */
+     We reconstruct cfun->cfg->x_basic_block_info->address () pointed
+     vector elements with NULL values in it for any missing basic blocks,
+     so that (a) == (b) for all of the blocks we create.  The
+     doubly-linked list of basic blocks (next_bb/prev_bb) skips over
+     these "holes".  */
 
   if (m_highest_bb_idx < bb_idx)
     m_highest_bb_idx = bb_idx;
--- gcc/gdbhooks.py.jj	2023-03-03 17:48:45.255040248 +0100
+++ gcc/gdbhooks.py	2023-03-03 18:42:06.609496428 +0100
@@ -133,10 +133,10 @@  vector: attempting to do so instead give
 or a (probably) invalid cast to vec<> for the memory after the vec (for
 vec[1] onwards).
 
-Instead (for now) you must access m_vecdata:
-  (gdb) p bb->preds->m_vecdata[0]
+Instead (for now) you must access the payload directly:
+  (gdb) p ((edge_def**)(bb->preds+1))[0]
   $20 = <edge 0x7ffff044d380 (3 -> 5)>
-  (gdb) p bb->preds->m_vecdata[1]
+  (gdb) p ((edge_def**)(bb->preds+1))[1]
   $21 = <edge 0x7ffff044d3b8 (4 -> 5)>
 """
 import os.path