Skip to content
Snippets Groups Projects
  • Jakub Jelinek's avatar
    e7176f75
    re PR target/82274 (__builtin_mul_overflow fails to detect overflow for... · e7176f75
    Jakub Jelinek authored
    re PR target/82274 (__builtin_mul_overflow fails to detect overflow for int64_t when compiled with -m32)
    
    	PR target/82274
    	* internal-fn.c (expand_mul_overflow): If both operands have
    	the same highpart of -1 or 0 and the topmost bit of lowpart
    	is different, overflow is if res <= 0 rather than res < 0.
    
    	* libgcc2.c (__mulvDI3): If both operands have
    	the same highpart of -1 and the topmost bit of lowpart is 0,
    	multiplication overflows even if both lowparts are 0.
    
    	* gcc.dg/pr82274-1.c: New test.
    	* gcc.dg/pr82274-2.c: New test.
    
    From-SVN: r253734
    e7176f75
    History
    re PR target/82274 (__builtin_mul_overflow fails to detect overflow for...
    Jakub Jelinek authored
    re PR target/82274 (__builtin_mul_overflow fails to detect overflow for int64_t when compiled with -m32)
    
    	PR target/82274
    	* internal-fn.c (expand_mul_overflow): If both operands have
    	the same highpart of -1 or 0 and the topmost bit of lowpart
    	is different, overflow is if res <= 0 rather than res < 0.
    
    	* libgcc2.c (__mulvDI3): If both operands have
    	the same highpart of -1 and the topmost bit of lowpart is 0,
    	multiplication overflows even if both lowparts are 0.
    
    	* gcc.dg/pr82274-1.c: New test.
    	* gcc.dg/pr82274-2.c: New test.
    
    From-SVN: r253734