public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48026] New: #pragma optimize ignored for C++
@ 2011-03-07 19:44 sam at robots dot org.uk
  2012-02-02  6:25 ` [Bug c++/48026] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: sam at robots dot org.uk @ 2011-03-07 19:44 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: #pragma optimize ignored for C++
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: sam@robots.org.uk


#pragma optimize seems to be ignored for C++.


=== Makefile ===
all: opt_c.s opt_cxx.s
.PHONY: all

opt_c.s: opt.c
    gcc -S -o $@ -O2 $<

opt_cxx.s: opt.c
    g++ -S -o $@ -O2 $<

clean:
    rm -f *.s
.PHONY: clean

=== opt.c ===
#pragma GCC optimize ("O0")

#ifdef __OPTIMIZE__
#error help!
#endif

int main () {
    int i;
    for (i = 0; i < 2000000000; ++i)
        ;
}

=== test output ===
$ make -k
gcc -S -o opt_c.s -O2 opt.c
g++ -S -o opt_cxx.s -O2 opt.c
opt.c:4:2: error: #error help!
make: *** [opt_cxx.s] Error 1
make: Target `all' not remade because of errors.


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

end of thread, other threads:[~2024-03-18  0:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07 19:44 [Bug c++/48026] New: #pragma optimize ignored for C++ sam at robots dot org.uk
2012-02-02  6:25 ` [Bug c++/48026] " pinskia at gcc dot gnu.org
2012-07-25 12:40 ` linux at carewolf dot com
2014-12-10 17:33 ` f.boesing at gmx dot de
2014-12-17 12:56 ` manu at gcc dot gnu.org
2023-12-06  8:31 ` [Bug c++/48026] #pragma optimize ignored for C++ for preprocessor gb.devel at gmail dot com
2023-12-06  8:33 ` sjames at gcc dot gnu.org
2023-12-06  8:35 ` sjames at gcc dot gnu.org
2024-03-18  0:32 ` 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).