public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47457] New: g++ calls without optimisation incorrectly from explicitly optimised code
@ 2011-01-25 13:30 vas.gurevich at gmail dot com
  2011-01-25 13:41 ` [Bug c++/47457] " vas.gurevich at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: vas.gurevich at gmail dot com @ 2011-01-25 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: g++ calls without optimisation incorrectly from
                    explicitly optimised code
           Product: gcc
           Version: 4.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vas.gurevich@gmail.com


Created attachment 23116
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23116
preprocessed source

When build this code without optimisation, like that,
g++ -o optimizetest optimizetest.cpp
looks like function call from optimised function passes wrong parameters to
static inline function

#include <stdio.h>

static inline void bar(int a)
{
    printf("%d\n", a);
}

void foo() __attribute__((optimize("O2")));

void foo()
{
    int a = 10;
    bar(a);
}

int main(int, char**)
{
    foo();
    return 0;
}

If compile with more than 0 optimisation level this works fine and prints 10,
otherwise when compile without optimisation this produces garbage instead of
10.


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

* [Bug c++/47457] g++ calls without optimisation incorrectly from explicitly optimised code
  2011-01-25 13:30 [Bug c++/47457] New: g++ calls without optimisation incorrectly from explicitly optimised code vas.gurevich at gmail dot com
@ 2011-01-25 13:41 ` vas.gurevich at gmail dot com
  2011-01-25 13:46 ` vas.gurevich at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: vas.gurevich at gmail dot com @ 2011-01-25 13:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Vasily Gurevich <vas.gurevich at gmail dot com> 2011-01-25 13:23:58 UTC ---
Created attachment 23117
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23117
optimizetest.cpp

Source file


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

* [Bug c++/47457] g++ calls without optimisation incorrectly from explicitly optimised code
  2011-01-25 13:30 [Bug c++/47457] New: g++ calls without optimisation incorrectly from explicitly optimised code vas.gurevich at gmail dot com
  2011-01-25 13:41 ` [Bug c++/47457] " vas.gurevich at gmail dot com
@ 2011-01-25 13:46 ` vas.gurevich at gmail dot com
  2011-01-25 13:54 ` juha.kallioinen at nokia dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: vas.gurevich at gmail dot com @ 2011-01-25 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Vasily Gurevich <vas.gurevich at gmail dot com> 2011-01-25 13:24:51 UTC ---
Created attachment 23118
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23118
gcc -v output


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

* [Bug c++/47457] g++ calls without optimisation incorrectly from explicitly optimised code
  2011-01-25 13:30 [Bug c++/47457] New: g++ calls without optimisation incorrectly from explicitly optimised code vas.gurevich at gmail dot com
  2011-01-25 13:41 ` [Bug c++/47457] " vas.gurevich at gmail dot com
  2011-01-25 13:46 ` vas.gurevich at gmail dot com
@ 2011-01-25 13:54 ` juha.kallioinen at nokia dot com
  2011-01-25 14:00 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: juha.kallioinen at nokia dot com @ 2011-01-25 13:54 UTC (permalink / raw)
  To: gcc-bugs

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

Juha Kallioinen <juha.kallioinen at nokia dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |juha.kallioinen at nokia
                   |                            |dot com

--- Comment #3 from Juha Kallioinen <juha.kallioinen at nokia dot com> 2011-01-25 13:41:42 UTC ---
Additional info: works on a 64bit Ubuntu Maverick (10.10) system, but not on a
32 bit one. Same problem with gcc-4.5.


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

* [Bug c++/47457] g++ calls without optimisation incorrectly from explicitly optimised code
  2011-01-25 13:30 [Bug c++/47457] New: g++ calls without optimisation incorrectly from explicitly optimised code vas.gurevich at gmail dot com
                   ` (2 preceding siblings ...)
  2011-01-25 13:54 ` juha.kallioinen at nokia dot com
@ 2011-01-25 14:00 ` redi at gcc dot gnu.org
  2011-01-25 14:11 ` vas.gurevich at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2011-01-25 14:00 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #23116|application/octet-stream    |text/plain
          mime type|                            |

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-25 13:44:39 UTC ---
Comment on attachment 23116
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23116
preprocessed source

this isn't preprocessed source, this is the assembler code


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

* [Bug c++/47457] g++ calls without optimisation incorrectly from explicitly optimised code
  2011-01-25 13:30 [Bug c++/47457] New: g++ calls without optimisation incorrectly from explicitly optimised code vas.gurevich at gmail dot com
                   ` (3 preceding siblings ...)
  2011-01-25 14:00 ` redi at gcc dot gnu.org
@ 2011-01-25 14:11 ` vas.gurevich at gmail dot com
  2011-01-25 16:39 ` [Bug target/47457] " rguenth at gcc dot gnu.org
  2021-08-30  1:36 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: vas.gurevich at gmail dot com @ 2011-01-25 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Vasily Gurevich <vas.gurevich at gmail dot com> 2011-01-25 13:51:14 UTC ---
Created attachment 23119
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23119
real preprocessed source

Excuse me, preprocessed source, just in case.


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

* [Bug target/47457] g++ calls without optimisation incorrectly from explicitly optimised code
  2011-01-25 13:30 [Bug c++/47457] New: g++ calls without optimisation incorrectly from explicitly optimised code vas.gurevich at gmail dot com
                   ` (4 preceding siblings ...)
  2011-01-25 14:11 ` vas.gurevich at gmail dot com
@ 2011-01-25 16:39 ` rguenth at gcc dot gnu.org
  2021-08-30  1:36 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-25 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |i?86-*-linux
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.01.25 16:28:34
          Component|c++                         |target
     Ever Confirmed|0                           |1
      Known to fail|                            |4.4.4, 4.5.2, 4.6.0

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-25 16:28:34 UTC ---
Confirmed.  I think this is a dup though.


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

* [Bug target/47457] g++ calls without optimisation incorrectly from explicitly optimised code
  2011-01-25 13:30 [Bug c++/47457] New: g++ calls without optimisation incorrectly from explicitly optimised code vas.gurevich at gmail dot com
                   ` (5 preceding siblings ...)
  2011-01-25 16:39 ` [Bug target/47457] " rguenth at gcc dot gnu.org
@ 2021-08-30  1:36 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-30  1:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47457

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
           Keywords|                            |wrong-code
             Status|NEW                         |RESOLVED

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 60062 which was fixed for GCC 4.8.3.

*** This bug has been marked as a duplicate of bug 60062 ***

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

end of thread, other threads:[~2021-08-30  1:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 13:30 [Bug c++/47457] New: g++ calls without optimisation incorrectly from explicitly optimised code vas.gurevich at gmail dot com
2011-01-25 13:41 ` [Bug c++/47457] " vas.gurevich at gmail dot com
2011-01-25 13:46 ` vas.gurevich at gmail dot com
2011-01-25 13:54 ` juha.kallioinen at nokia dot com
2011-01-25 14:00 ` redi at gcc dot gnu.org
2011-01-25 14:11 ` vas.gurevich at gmail dot com
2011-01-25 16:39 ` [Bug target/47457] " rguenth at gcc dot gnu.org
2021-08-30  1:36 ` pinskia 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).