Something wired when I tried to blit a surface with an alphamod

Here is the code:

#include<stdio.h>
#include<SDL2/SDL.h>
int main(){
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Window win = SDL_CreateWindow(“Hello World!”, 100, 100, 640,
480,SDL_WINDOW_SHOWN);
SDL_Renderer ren = SDL_CreateRenderer(win, -1,
SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
Uint32 rmask, gmask, bmask, amask;
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
rmask = 0xff000000;
gmask = 0x00ff0000;
bmask = 0x0000ff00;
amask = 0x000000ff;
#else
rmask = 0x000000ff;
gmask = 0x0000ff00;
bmask = 0x00ff0000;
amask = 0xff000000;
#endif
SDL_Surface
surface = SDL_CreateRGBSurface(0, 640, 480, 32, rmask,
gmask, bmask, amask);
SDL_Surface
surface2 = SDL_CreateRGBSurface(0, 320, 240, 32, rmask,
gmask, bmask, amask);

SDL_FillRect(surface2,NULL,SDL_MapRGBA(surface2->format,255,0,0,255));

SDL_SetSurfaceAlphaMod(surface2,128); //!!!

//SDL_SetSurfaceBlendMode(surface2,SDL_BLENDMODE_NONE);

SDL_BlitSurface(surface2, NULL, surface, NULL);



SDL_Texture *tex = SDL_CreateTextureFromSurface(ren, surface);
SDL_RenderClear(ren);
SDL_RenderCopy(ren, tex, NULL, &surface->clip_rect);
SDL_RenderPresent(ren);
SDL_Delay(2000);
SDL_FreeSurface(surface);
SDL_FreeSurface(surface2);
SDL_DestroyTexture(tex);
SDL_DestroyRenderer(ren);
SDL_DestroyWindow(win);
SDL_Quit();

}

I try to blit surface2(a red rect) into surface,but all I got is only a
black window.But when I deleted the line which is marked with !!!,The red
rect shows.
The red rect will also appear when I set the blendmode of surface2 to
SDL_BLENDMODE_NONE
What’s more,I also tried to fill surface with a color,it works.
According to sdl wiki,it says dstA = srcA + (dstA * (1-srcA)),srcA = srcA *
(alphamod / 255),but in this code,it don’t work as I assumed.Does this
could be a bug or something?Or just I was misunderstanding about that?

I got the same problem before with SDL_BlitScaled :

I’m working on archlinux x64 , SDL 2.0.3

Sorry for my poor grammar and spelling,I comes from a non-English speaking
country.