public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57080] New: Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?))
@ 2013-04-26 10:26 ondrej at sury dot org
  2013-04-26 10:27 ` [Bug c/57080] " ondrej at sury dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ondrej at sury dot org @ 2013-04-26 10:26 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57080
           Summary: Invalid optimization (-O2) when doing double -> int
                    conversion (on big endian archs(?))
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ondrej@sury.org


Reproduceable on:

Using built-in specs.
COLLECT_GCC=gcc-4.6
COLLECT_LTO_WRAPPER=/usr/lib/gcc/ia64-linux-gnu/4.6/lto-wrapper
Target: ia64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-15'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--disable-libssp --enable-plugin --enable-objc-gc --with-system-libunwind
--enable-checking=release --build=ia64-linux-gnu --host=ia64-linux-gnu
--target=ia64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-15) 

and

Using built-in specs.
COLLECT_GCC=gcc-4.7
COLLECT_LTO_WRAPPER=/usr/lib/gcc/ia64-linux-gnu/4.7/lto-wrapper
Target: ia64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5'
--with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--disable-libssp --disable-libitm --enable-plugin --enable-objc-gc
--with-system-libunwind --enable-checking=release --build=ia64-linux-gnu
--host=ia64-linux-gnu --target=ia64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5) 


This bug manifest itself on ia64, powerpc and s390x (all Big Endian[1]) where
gcc-4.6 is used and the optmized code (-O2) fails to produce correct math
results.

This code from libgd2:src/gd.c:clip_1d:

  *y1 -= m * (*x1 - mindim);

where

  m = (double) -0.050000
  *x1 = -200
  mindim = 0
  *y1 = 15

results in *y1 = 4, which is incorrect value, since it should be 5.

Most simple workaround, which allows gcc to produce correct value:

  *y1 -= (int)(m * (*x1 - mindim));

Assigning to some other variable also works ok:

  int t;
  t = m * (*x1 - mindim);
  *y1 -= t;

Compiling with -O0 also produces correct value.

1. Although SPARC, which should be B-E too, was built correctly.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/57080] Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?))
  2013-04-26 10:26 [Bug c/57080] New: Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?)) ondrej at sury dot org
@ 2013-04-26 10:27 ` ondrej at sury dot org
  2013-04-26 11:04 ` ondrej at sury dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ondrej at sury dot org @ 2013-04-26 10:27 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Ondřej Surý <ondrej at sury dot org> 2013-04-26 10:27:30 UTC ---
Created attachment 29945
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29945
Generated from gd.c, affected code is in clip_1d function
>From gcc-bugs-return-421009-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 26 10:37:59 2013
Return-Path: <gcc-bugs-return-421009-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5516 invoked by alias); 26 Apr 2013 10:37:59 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5495 invoked by uid 48); 26 Apr 2013 10:37:56 -0000
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/55708] g++ crashes: constexpr function with reference parameters.
Date: Fri, 26 Apr 2013 10:37:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Keywords:
X-Bugzilla-Severity: major
X-Bugzilla-Who: daniel.kruegler at googlemail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields:
Message-ID: <bug-55708-4-EPbq0WTud8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-55708-4@http.gcc.gnu.org/bugzilla/>
References: <bug-55708-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg02154.txt.bz2
Content-length: 246


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

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2013-04-26 10:37:55 UTC ---
gcc 4.9.0 20130421 (experimental) accepts the code on my system (64-bit mingw).
>From gcc-bugs-return-421010-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 26 10:54:48 2013
Return-Path: <gcc-bugs-return-421010-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21609 invoked by alias); 26 Apr 2013 10:54:48 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 21566 invoked by uid 48); 26 Apr 2013 10:54:45 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/57075] [4.9 Regression] verify_flow_info failed: control flow in the middle of basic block
Date: Fri, 26 Apr 2013 10:54:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57075-4-85pimWrgfN@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57075-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57075-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg02155.txt.bz2
Content-length: 466


http://gcc.gnu.org/bugzilla/show_bug.cgi?idW075

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-04-26 10:54:45 UTC ---
Ok, I think I reduced this issue to this:

/* PR tree-optimization/57075 */
/* { dg-do compile } */
/* { dg-options "-O2" } */

extern int baz (void) __attribute__ ((returns_twice));
int __attribute__ ((__leaf__))
foo (void)
{
  return __builtin_printf ("$");
}

void
bar ()
{
  foo ();
  baz ();
}


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/57080] Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?))
  2013-04-26 10:26 [Bug c/57080] New: Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?)) ondrej at sury dot org
  2013-04-26 10:27 ` [Bug c/57080] " ondrej at sury dot org
@ 2013-04-26 11:04 ` ondrej at sury dot org
  2013-04-26 12:32 ` ondrej at sury dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ondrej at sury dot org @ 2013-04-26 11:04 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Ondřej Surý <ondrej at sury dot org> 2013-04-26 11:04:19 UTC ---
Maybe I should have said "inconsistent" and this might be related to:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27394
>From gcc-bugs-return-421012-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 26 11:23:17 2013
Return-Path: <gcc-bugs-return-421012-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15883 invoked by alias); 26 Apr 2013 11:23:17 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 15842 invoked by uid 48); 26 Apr 2013 11:23:13 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/57075] [4.9 Regression] verify_flow_info failed: control flow in the middle of basic block
Date: Fri, 26 Apr 2013 11:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57075-4-WPrS3d4ePi@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57075-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57075-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg02157.txt.bz2
Content-length: 304


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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-04-26 11:23:13 UTC ---
b.c: In function ‘bar’:
b.c:17:1: error: control flow in the middle of basic block 2

<bb 2>:
_5 = __builtin_printf ("$");
D.1727 = _5;
>From gcc-bugs-return-421013-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 26 11:25:41 2013
Return-Path: <gcc-bugs-return-421013-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17109 invoked by alias); 26 Apr 2013 11:25:41 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 17075 invoked by uid 48); 26 Apr 2013 11:25:38 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/57075] [4.9 Regression] verify_flow_info failed: control flow in the middle of basic block
Date: Fri, 26 Apr 2013 11:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57075-4-YFjtAfUpeo@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57075-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57075-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg02158.txt.bz2
Content-length: 467


http://gcc.gnu.org/bugzilla/show_bug.cgi?idW075

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2013-04-26 11:25:38 UTC ---
Ok, that's because printf is considered a possible caller of longjmp but
inlining doesn't split the block before handling the return.

We need to possibly split blocks dependent on stmt_ends_bb_p which depends
on function context.  Similar testcase can be constructed with non-local
gotos, broken before r198192.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/57080] Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?))
  2013-04-26 10:26 [Bug c/57080] New: Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?)) ondrej at sury dot org
  2013-04-26 10:27 ` [Bug c/57080] " ondrej at sury dot org
  2013-04-26 11:04 ` ondrej at sury dot org
@ 2013-04-26 12:32 ` ondrej at sury dot org
  2013-04-26 16:11 ` pinskia at gcc dot gnu.org
  2013-04-26 17:15 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ondrej at sury dot org @ 2013-04-26 12:32 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Ondřej Surý <ondrej at sury dot org> 2013-04-26 12:32:20 UTC ---
Yeah, I just came to same conclusion by reading further (PR9325), that it's not
related to PR27394, because we are not hitting the boundaries of the conversion
type.

I understand that the resulting value depends on the time the conversion happen
(e.g. when the fractional part gets discarded), but still I think there's
something wrong when the result depends on the architecture and the
optimization level.
>From gcc-bugs-return-421028-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 26 13:16:27 2013
Return-Path: <gcc-bugs-return-421028-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18621 invoked by alias); 26 Apr 2013 13:16:27 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 18562 invoked by uid 48); 26 Apr 2013 13:16:23 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/57003] [4.8/4.9 Regression] gcc-4.8.0 breaks -O2 optimization with Wine(64) - links/info/bisect of commits included
Date: Fri, 26 Apr 2013 13:16:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.1
X-Bugzilla-Changed-Fields: Status Resolution
Message-ID: <bug-57003-4-QLO4th9bUb@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57003-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57003-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg02173.txt.bz2
Content-length: 1632


http://gcc.gnu.org/bugzilla/show_bug.cgi?idW003

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #21 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-26 13:16:21 UTC ---
Author: jakub
Date: Thu Apr 25 21:49:22 2013
New Revision: 198320

URL: http://gcc.gnu.org/viewcvs?rev\x198320&root=gcc&view=rev
Log:
    PR rtl-optimization/57003
    * regcprop.c (copyprop_hardreg_forward_1): If ksvd.ignore_set_reg,
    call note_stores with kill_clobbered_value callback again after
    killing regs_invalidated_by_call.

    * gcc.target/i386/pr57003.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr57003.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/regcprop.c
    trunk/gcc/testsuite/ChangeLog

Author: jakub
Date: Thu Apr 25 21:50:26 2013
New Revision: 198321

URL: http://gcc.gnu.org/viewcvs?rev\x198321&root=gcc&view=rev
Log:
    PR rtl-optimization/57003
    * regcprop.c (copyprop_hardreg_forward_1): If ksvd.ignore_set_reg,
    call note_stores with kill_clobbered_value callback again after
    killing regs_invalidated_by_call.

    * gcc.target/i386/pr57003.c: New test.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.target/i386/pr57003.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/regcprop.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/57080] Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?))
  2013-04-26 10:26 [Bug c/57080] New: Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?)) ondrej at sury dot org
                   ` (2 preceding siblings ...)
  2013-04-26 12:32 ` ondrej at sury dot org
@ 2013-04-26 16:11 ` pinskia at gcc dot gnu.org
  2013-04-26 17:15 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-04-26 16:11 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-04-26 16:11:38 UTC ---
(In reply to comment #5)
> I swear I have read the (non) bugs section before reporting the bug. Anyway
> it's do damn confusing that the result can be different on different
> architectures :(.

Rather on older architectures where the fpu was implemented as a stack one
(both 68k and x86 are examples of this).


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/57080] Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?))
  2013-04-26 10:26 [Bug c/57080] New: Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?)) ondrej at sury dot org
                   ` (3 preceding siblings ...)
  2013-04-26 16:11 ` pinskia at gcc dot gnu.org
@ 2013-04-26 17:15 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-26 17:15 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-26 17:15:52 UTC ---
I'd say *y1 -= (int)(m * (*x1 - mindim)); isn't a workaround, but a reasonable
thing to do (and less expensive than converting *y1 from int to floating point,
doing subtraction in FPU and converting back.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-26 17:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-26 10:26 [Bug c/57080] New: Invalid optimization (-O2) when doing double -> int conversion (on big endian archs(?)) ondrej at sury dot org
2013-04-26 10:27 ` [Bug c/57080] " ondrej at sury dot org
2013-04-26 11:04 ` ondrej at sury dot org
2013-04-26 12:32 ` ondrej at sury dot org
2013-04-26 16:11 ` pinskia at gcc dot gnu.org
2013-04-26 17:15 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).