This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [bugs] a gcc sign bug?


On Thu, May 31, 2001 at 12:53:51PM +0200, Jan Hubicka wrote:
> > gcc will generate:
> > 
> > itsabug:
> > .LFB1:
> >         pushq   %rbp
> > .LCFI0:
> >         movq    %rsp, %rbp
> > .LCFI1:
> >         movq    kva_start(%rip), %rsi
> >         subq    $2147483648, %rsi
> > 		^^^^^^^^^^^
> >         movl    $.LC0, %edi
> >         movb    $0, %al
> >         call    printf
> >         popq    %rbp
> > .LCFI2:
> >         ret
> the patch fixes it by converting subq to addq, in same way as we keep -128
> as addq.
> 
> Thu May 31 12:52:38 CEST 2001  Jan Hubicka  <jh@suse.cz>
> + 	  /* Avoid overflows.  */
> + 	  && ((INTVAL (operands[2]) & ((1 << 31) - 1)))

I don't like this especially.  I'd rather we used INT_MIN
and such, but this is a HOST_WIDE_INT.  

Would you create HOST_WIDE_INT_MIN and HOST_WIDE_INT_MAX
defines in hwint.h and use that instead?


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]