Optimisation of division in gcc

前端 未结 4 1070
無奈伤痛
無奈伤痛 2021-01-17 19:43

Here\'s some code (full program follows later in the question):

template 
T fizzbuzz(T n) {
    T count(0);
    #if CONST
        const T d         


        
4条回答
  •  庸人自扰
    2021-01-17 20:10

    I'm guessing its just the severely old GCC version you are running. The oldest compiler I have on my machine - gcc-4.1.2, performs the fast way with both the non-const and the wrap versions (and does so at only -O1).

提交回复
热议问题