无法从 gcc 的 -fdump-tree-gimple 中找出 /[ex] 运算符
Cannot figure out /[ex] operator from gcc's -fdump-tree-gimple
使用-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中的较快者之间进行选择。
相关文章:
- 为什么比较运算符如此快速
- C++映射:具有自定义类的运算符[]不起作用(总是返回0)
- 使用C++中的模板和运算符重载执行矩阵运算
- 为什么这个运算符<重载函数对 STL 算法不可见?
- 增量运算符与后缀混淆
- 一个关于在C++中重载布尔运算符的问题
- 运算符C++ "delete []"仅删除 2 个前值
- 模板类无法识别友元运算符
- 我可以使用条件运算符初始化C风格的字符串文字吗
- 关闭||运算符优化
- 通过继承类使用来自不同命名空间的运算符
- C++Cast运算符过载
- 如何使用AngelScript注册SFML Vector2运算符
- 重载元组索引运算符-C++
- 如何使用重载的相等(==)运算符向测试用例添加描述
- 为什么Mat类的两个对象可以在不重载运算符+的情况下添加
- 多个If语句与使用逻辑运算符计算条件的单个语句的比较
- 布尔比较运算符是如何在C++中工作的
- 重载运算符new[]的行为取决于析构函数
- 无法从 gcc 的 -fdump-tree-gimple 中找出 /[ex] 运算符