public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/56513] New: Wrong code generation with -O3 on ARM
@ 2013-03-03 18:45 tim.kosse@filezilla-project.org
  2013-03-03 18:47 ` [Bug target/56513] " tim.kosse@filezilla-project.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tim.kosse@filezilla-project.org @ 2013-03-03 18:45 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56513
           Summary: Wrong code generation with -O3 on ARM
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tim.kosse@filezilla-project.org


Created attachment 29571
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29571
Small test program exhibiting the problem

If I'm cross-compiling the attached sample-program using gcc 4.7.2 for ARM on
an x86-64 system, the resulting binary behaves wrongly if -O3 is used.

Output with -O0:

value: -23
best:  -10000
a:     -68
value: -22
best:  -23
a:     -23

Output with -O3:

value: -23
best:  -10000
a:     -68
value: -22
best:  -23
a:     65513
BUG


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

* [Bug target/56513] Wrong code generation with -O3 on ARM
  2013-03-03 18:45 [Bug target/56513] New: Wrong code generation with -O3 on ARM tim.kosse@filezilla-project.org
@ 2013-03-03 18:47 ` tim.kosse@filezilla-project.org
  2013-03-03 18:49 ` tim.kosse@filezilla-project.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tim.kosse@filezilla-project.org @ 2013-03-03 18:47 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Tim Kosse <tim.kosse@filezilla-project.org> 2013-03-03 18:47:18 UTC ---
Created attachment 29572
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29572
Preprocessed file

Created using the following command:
arm-unknown-linux-gnueabi-g++ -v -save-temps -O3 bug.cpp


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

* [Bug target/56513] Wrong code generation with -O3 on ARM
  2013-03-03 18:45 [Bug target/56513] New: Wrong code generation with -O3 on ARM tim.kosse@filezilla-project.org
  2013-03-03 18:47 ` [Bug target/56513] " tim.kosse@filezilla-project.org
@ 2013-03-03 18:49 ` tim.kosse@filezilla-project.org
  2013-03-03 18:55 ` tim.kosse@filezilla-project.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tim.kosse@filezilla-project.org @ 2013-03-03 18:49 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Tim Kosse <tim.kosse@filezilla-project.org> 2013-03-03 18:48:49 UTC ---
Created attachment 29573
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29573
Compiler output

Output of arm-unknown-linux-gnueabi-g++ -v -save-temps -O3 bug.cpp


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

* [Bug target/56513] Wrong code generation with -O3 on ARM
  2013-03-03 18:45 [Bug target/56513] New: Wrong code generation with -O3 on ARM tim.kosse@filezilla-project.org
  2013-03-03 18:47 ` [Bug target/56513] " tim.kosse@filezilla-project.org
  2013-03-03 18:49 ` tim.kosse@filezilla-project.org
@ 2013-03-03 18:55 ` tim.kosse@filezilla-project.org
  2013-03-03 20:11 ` mikpe at it dot uu.se
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tim.kosse@filezilla-project.org @ 2013-03-03 18:55 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Tim Kosse <tim.kosse@filezilla-project.org> 2013-03-03 18:55:20 UTC ---
Also happens with GCC 4.7.1 and 4.6.3.


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

* [Bug target/56513] Wrong code generation with -O3 on ARM
  2013-03-03 18:45 [Bug target/56513] New: Wrong code generation with -O3 on ARM tim.kosse@filezilla-project.org
                   ` (2 preceding siblings ...)
  2013-03-03 18:55 ` tim.kosse@filezilla-project.org
@ 2013-03-03 20:11 ` mikpe at it dot uu.se
  2013-03-03 23:27 ` mikpe at it dot uu.se
  2013-03-04 13:24 ` mikpe at it dot uu.se
  5 siblings, 0 replies; 7+ messages in thread
From: mikpe at it dot uu.se @ 2013-03-03 20:11 UTC (permalink / raw)
  To: gcc-bugs


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

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #4 from Mikael Pettersson <mikpe at it dot uu.se> 2013-03-03 20:11:08 UTC ---
I can reproduce the wrong-code on armv5tel-linux-gnueabi with gcc-4.7-20130302
and gcc-4.6-20121109, but not with gcc-4.8-20130224.  I can't reproduce on
x86_64, sparc64, aarch64, or m68k.


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

* [Bug target/56513] Wrong code generation with -O3 on ARM
  2013-03-03 18:45 [Bug target/56513] New: Wrong code generation with -O3 on ARM tim.kosse@filezilla-project.org
                   ` (3 preceding siblings ...)
  2013-03-03 20:11 ` mikpe at it dot uu.se
@ 2013-03-03 23:27 ` mikpe at it dot uu.se
  2013-03-04 13:24 ` mikpe at it dot uu.se
  5 siblings, 0 replies; 7+ messages in thread
From: mikpe at it dot uu.se @ 2013-03-03 23:27 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Mikael Pettersson <mikpe at it dot uu.se> 2013-03-03 23:26:49 UTC ---
The wrong-code stopped for 4.8 with r188526, the introduction and enabling of
-ftree-coalesce-vars.  At that point the wrong-code reappears with -O3
-fno-tree-coalesce-vars, however with current trunk those options give correct
code.  I'll investigate some more tomorrow.


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

* [Bug target/56513] Wrong code generation with -O3 on ARM
  2013-03-03 18:45 [Bug target/56513] New: Wrong code generation with -O3 on ARM tim.kosse@filezilla-project.org
                   ` (4 preceding siblings ...)
  2013-03-03 23:27 ` mikpe at it dot uu.se
@ 2013-03-04 13:24 ` mikpe at it dot uu.se
  5 siblings, 0 replies; 7+ messages in thread
From: mikpe at it dot uu.se @ 2013-03-04 13:24 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Mikael Pettersson <mikpe at it dot uu.se> 2013-03-04 13:24:04 UTC ---
The wrong-code with -O3 -fno-tree-coalesce-vars stopped occurring at r190284,
Richard Biener's large "Allow anonymous SSA names" patch.  The patch
description mentions minor code generation differences, but it doesn't appear
to contain actual wrong code fixes so the underlying issue may still be latent
on trunk.


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

end of thread, other threads:[~2013-03-04 13:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-03 18:45 [Bug target/56513] New: Wrong code generation with -O3 on ARM tim.kosse@filezilla-project.org
2013-03-03 18:47 ` [Bug target/56513] " tim.kosse@filezilla-project.org
2013-03-03 18:49 ` tim.kosse@filezilla-project.org
2013-03-03 18:55 ` tim.kosse@filezilla-project.org
2013-03-03 20:11 ` mikpe at it dot uu.se
2013-03-03 23:27 ` mikpe at it dot uu.se
2013-03-04 13:24 ` mikpe at it dot uu.se

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).