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

Cannot figure out /[ex] operator from gcc's -fdump-tree-gimple

本文关键字:ex 运算符 gcc -fdump-tree-gimple      更新时间:2023-10-16

使用-fdump-tree gimple选项(GCC 4.6.1)编译C++时,我得到的代码中有以下函数:

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>:
}

您可以通过制作一个使用std::vector<int>的简单程序来获得这些代码。无论如何,我不理解的代码部分是D.8487 = D.8486 /[ex] 4;。我查看了/usr/include/c++/4.6.1/std_vector.h的源代码,它的析构函数是一个调用_M_deallocate的单行函数。有人知道操作员/[ex]代表什么吗?到目前为止,我唯一注意到的是,RHS操作数是向量参数化的类型的大小。

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

来自GCC内部构件手册:

EXACT_DIV_EXPR

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