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

* [Bug c++/48026] #pragma optimize ignored for C++
  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 ` pinskia at gcc dot gnu.org
  2012-07-25 12:40 ` linux at carewolf dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-02  6:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-02
         Depends on|                            |41201
     Ever Confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-02 06:24:46 UTC ---
Confirmed, this is most likely the same issue as PR 41201.


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

* [Bug c++/48026] #pragma optimize ignored for C++
  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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: linux at carewolf dot com @ 2012-07-25 12:40 UTC (permalink / raw)
  To: gcc-bugs

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

Allan Jensen <linux at carewolf dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |linux at carewolf dot com

--- Comment #2 from Allan Jensen <linux at carewolf dot com> 2012-07-25 12:40:22 UTC ---
(In reply to comment #1)
> Confirmed, this is most likely the same issue as PR 41201.

Well, not completely the same. The original issue reported in PR 41201 is about
defining the macros, but the possible fix in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41201#c6 is about this bug.


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

* [Bug c++/48026] #pragma optimize ignored for C++
  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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: f.boesing at gmx dot de @ 2014-12-10 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

Frank <f.boesing at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |f.boesing at gmx dot de

--- Comment #3 from Frank <f.boesing at gmx dot de> ---
Still existent in 4.8.4


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

* [Bug c++/48026] #pragma optimize ignored for C++
  2011-03-07 19:44 [Bug c++/48026] New: #pragma optimize ignored for C++ sam at robots dot org.uk
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: manu at gcc dot gnu.org @ 2014-12-17 12:56 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

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

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
This is probably because the preprocessor runs before the #pragmas are handled.
If so, this is the same issue as for #pragma GCC diagnostics in C++ (PR53431).
>From gcc-bugs-return-470986-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Dec 17 13:07:02 2014
Return-Path: <gcc-bugs-return-470986-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1520 invoked by alias); 17 Dec 2014 13:07:02 -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 1457 invoked by uid 48); 17 Dec 2014 13:06:58 -0000
From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/64336] Template functions are not instrumented at -O0 and -Og
Date: Wed, 17 Dec 2014 13:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: sanitizer
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: bernd.edlinger at hotmail dot de
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-64336-4-bEIKMHBHtC@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64336-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64336-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-12/txt/msg01993.txt.bz2
Content-length: 242

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd336

--- Comment #3 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
Yes, this patch seems to work...

But why did this only cause problems with template expansions and nothing else
?


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

* [Bug c++/48026] #pragma optimize ignored for C++ for preprocessor
  2011-03-07 19:44 [Bug c++/48026] New: #pragma optimize ignored for C++ sam at robots dot org.uk
                   ` (3 preceding siblings ...)
  2014-12-17 12:56 ` manu at gcc dot gnu.org
@ 2023-12-06  8:31 ` gb.devel at gmail dot com
  2023-12-06  8:33 ` sjames at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gb.devel at gmail dot com @ 2023-12-06  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

Gwenole Beauchesne <gb.devel at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gb.devel at gmail dot com

--- Comment #5 from Gwenole Beauchesne <gb.devel at gmail dot com> ---
Created attachment 56811
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56811&action=edit
Proposed patch against trunk

Here is a proposed patch against trunk, which includes a fix for PR
preprocessor/87299 (#pragma GCC target).

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

* [Bug c++/48026] #pragma optimize ignored for C++ for preprocessor
  2011-03-07 19:44 [Bug c++/48026] New: #pragma optimize ignored for C++ sam at robots dot org.uk
                   ` (4 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-12-06  8:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48026
Bug 48026 depends on bug 41201, which changed state.

Bug 41201 Summary: #pragma GCC target ("sse2") doesn't alter __SSE2__ in C++ (as it does in C)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41201

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

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

* [Bug c++/48026] #pragma optimize ignored for C++ for preprocessor
  2011-03-07 19:44 [Bug c++/48026] New: #pragma optimize ignored for C++ sam at robots dot org.uk
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-12-06  8:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Gwenole Beauchesne from comment #5)
> Created attachment 56811 [details]
> Proposed patch against trunk
> 
> Here is a proposed patch against trunk, which includes a fix for PR
> preprocessor/87299 (#pragma GCC target).

Could you send this to the mailing list if it's still relevant? Thanks.

(https://gcc.gnu.org/contribute.html)

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

* [Bug c++/48026] #pragma optimize ignored for C++ for preprocessor
  2011-03-07 19:44 [Bug c++/48026] New: #pragma optimize ignored for C++ sam at robots dot org.uk
                   ` (6 preceding siblings ...)
  2023-12-06  8:35 ` sjames at gcc dot gnu.org
@ 2024-03-18  0:32 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-18  0:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tellowkrinkle at gmail dot com

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 114370 has been marked as a duplicate of this bug. ***

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