无法从 gcc 的 -fdump-tree-gimple 中找出 /[ex] 运算符

发布于 2025-01-02 05:59:06 字数 1311 浏览 1 评论 0原文

包含以下函数:

std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int, _Alloc = std::allocator<int>] (struct _Vector_base * const this)
{
  int * D.8482;
  long int D.8483;
  int * D.8484;
  long int D.8485;
  long int D.8486;
  long int D.8487;
  long unsigned int D.8488;
  int * D.8489;
  struct _Vector_impl * D.8490;

  {
    try
      {
        D.8482 = this->_M_impl._M_end_of_storage;
        D.8483 = (long int) D.8482;
        D.8484 = this->_M_impl._M_start;
        D.8485 = (long int) D.8484;
        D.8486 = D.8483 - D.8485;
        D.8487 = D.8486 /[ex] 4;
        D.8488 = (long unsigned int) D.8487;
        D.8489 = this->_M_impl._M_start;
        std::_Vector_base<int, std::allocator<int> >::_M_deallocate(this, D.8489, D.8488);
      }
    finally
      {
        D.8490 = &this->_M_impl;
        std::_Vector_base<int, std::allocator<int>::_Vector_impl::~_Vector_impl (D.8490);
      }
  }
  <D.8393>:
}

当使用 -fdump-tree-gimple 选项(GCC 4.6.1)编译 C++ 时,我得到的代码 int>。无论如何,我不理解的代码部分是 D.8487 = D.8486 /[ex] 4; 行。我查看了 /usr/include/c++/4.6.1/std_vector.h 的源代码,它的析构函数是一个调用 _M_deallocate 的单行函数。有谁知道运算符 /[ex] 代表什么?到目前为止我唯一注意到的是 RHS 操作数是向量参数化类型的大小。

When compiling C++ with the -fdump-tree-gimple option (GCC 4.6.1), I get code that has the following function in it:

std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int, _Alloc = std::allocator<int>] (struct _Vector_base * const this)
{
  int * D.8482;
  long int D.8483;
  int * D.8484;
  long int D.8485;
  long int D.8486;
  long int D.8487;
  long unsigned int D.8488;
  int * D.8489;
  struct _Vector_impl * D.8490;

  {
    try
      {
        D.8482 = this->_M_impl._M_end_of_storage;
        D.8483 = (long int) D.8482;
        D.8484 = this->_M_impl._M_start;
        D.8485 = (long int) D.8484;
        D.8486 = D.8483 - D.8485;
        D.8487 = D.8486 /[ex] 4;
        D.8488 = (long unsigned int) D.8487;
        D.8489 = this->_M_impl._M_start;
        std::_Vector_base<int, std::allocator<int> >::_M_deallocate(this, D.8489, D.8488);
      }
    finally
      {
        D.8490 = &this->_M_impl;
        std::_Vector_base<int, std::allocator<int>::_Vector_impl::~_Vector_impl (D.8490);
      }
  }
  <D.8393>:
}

You can get this code by making a simple program that uses std::vector<int>. In any case, the part of the code I do not understand is the line with D.8487 = D.8486 /[ex] 4;. I looked at the source code for /usr/include/c++/4.6.1/std_vector.h, and its destructor is a one-liner that calls _M_deallocate. Does anyone know what the operator /[ex] stands for? The only thing I have noticed so far is that the RHS operand is the size of the type the vector parameterizes over.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

妖妓 2025-01-09 05:59:06

/[ex] 表示它是一个精确的除法表达式。

来自 GCC 内部手册:

EXACT_DIV_EXPR

EXACT_DIV_EXPR 代码用于表示整数除法,其中分子已知为分母的精确倍数。这允许后端为当前目标选择 TRUNC_DIV_EXPR、CEIL_DIV_EXPR 和 FLOOR_DIV_EXPR 中较快的一个。

/[ex] means that it's an exact divide expression.

From the GCC internals manual:

EXACT_DIV_EXPR

The EXACT_DIV_EXPR code is used to represent integer divisions where the numerator is known to be an exact multiple of the denominator. This allows the backend to choose between the faster of TRUNC_DIV_EXPR, CEIL_DIV_EXPR and FLOOR_DIV_EXPR for the current target.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文