[Bug c/44376] New: optimiser destroys possibility of detecting overflow

2010-06-02 Thread geoff at dyalog dot com
optimiser generates SSE instructions that add 32 bit quantities when the field
being referenced is actually 21 bits wide. This disables the possibility of
testing the overflow of the additions.


-- 
   Summary: optimiser destroys possibility of detecting overflow
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: geoff at dyalog dot com
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44376



[Bug c/44376] optimiser destroys possibility of detecting overflow

2010-06-02 Thread geoff at dyalog dot com


--- Comment #1 from geoff at dyalog dot com  2010-06-02 11:09 ---
Created an attachment (id=20807)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20807&action=view)
example code to demonstrate bug

extract code using "cpio -i http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44376



[Bug tree-optimization/44376] optimiser destroys possibility of detecting overflow

2010-06-02 Thread geoff at dyalog dot com


--- Comment #3 from geoff at dyalog dot com  2010-06-02 11:36 ---
Subject: Re:  optimiser destroys possibility
 of detecting overflow

On 02/06/10 12:17, rguenth at gcc dot gnu dot org wrote:
> --- Comment #2 from rguenth at gcc dot gnu dot org  2010-06-02 11:17 
> ---
> Please specify the GCC version you see this bug.  I think it has been fixed
> with GCC 4.5.0.
>
> gcc-4.4 -o t main.c slave.c -O3
>> ./t
> overflow assigning 12524191771
> total returned = 27
>
> gcc-4.5 -o t main.c slave.c -O3
>> ./t
> total returned = 27
>
>

Yes I am using 4.4.3.

Thankyou for the stunning response.

Geoff


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44376