public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/53776] New: pragma optimize does not support Os
@ 2012-06-26  8:15 vincenzo.innocente at cern dot ch
  2012-06-26  8:43 ` [Bug middle-end/53776] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-06-26  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53776
           Summary: pragma optimize does not support Os
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vincenzo.innocente@cern.ch


I need to compile optimized for size some portion of code.
The easiest is to "inject" pragmas in the source code at building time

unfortunately Os (and I think also Ofast) are not supported in 
pragma optimize (and I think also not by __attribute__)
only numbers works

for instance take

cat optopt.cc
#pragma GCC optimize ("s")

void bar(int);

inline void foo(int i, int j) {
  if (i>0) bar(i);
  if (j>0) bar(j);
  if (i>0) bar(j);
  if (j>0) bar(i);
 };


void foo1(int i, int j) {
  foo(i,j);
}
void foo2(int i, int j) {
  foo(i,j);
}
void foo3(int i, int j) {
  foo(i,j);
}

c++ -O2 -c optopt.cc; nm -C optopt.o
                 U bar(int)
0000000000000000 T foo1(int, int)
0000000000000060 T foo2(int, int)
00000000000000c0 T foo3(int, int)
 c++ -Os -c optopt.cc; nm -C optopt.o
                 U bar(int)
0000000000000000 W foo(int, int)
0000000000000000 T foo1(int, int)
0000000000000005 T foo2(int, int)
000000000000000a T foo3(int, int)

with
#pragma GCC optimize ("1")
one gets what intended
c++ -O2 -c optopt.cc; nm -C optopt.o
                 U bar(int)
0000000000000000 W foo(int, int)
0000000000000000 T foo1(int, int)
0000000000000010 T foo2(int, int)
0000000000000020 T foo3(int, int)


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

* [Bug middle-end/53776] pragma optimize does not support Os
  2012-06-26  8:15 [Bug middle-end/53776] New: pragma optimize does not support Os vincenzo.innocente at cern dot ch
@ 2012-06-26  8:43 ` pinskia at gcc dot gnu.org
  2012-06-26  8:58 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-06-26  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-06-26 08:43:36 UTC ---
Ofast is recorded as PR 48110.


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

* [Bug middle-end/53776] pragma optimize does not support Os
  2012-06-26  8:15 [Bug middle-end/53776] New: pragma optimize does not support Os vincenzo.innocente at cern dot ch
  2012-06-26  8:43 ` [Bug middle-end/53776] " pinskia at gcc dot gnu.org
@ 2012-06-26  8:58 ` rguenth at gcc dot gnu.org
  2021-08-12  5:41 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-26  8:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-06-26
             Blocks|                            |48110
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-26 08:57:52 UTC ---
Confirmed.


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

* [Bug middle-end/53776] pragma optimize does not support Os
  2012-06-26  8:15 [Bug middle-end/53776] New: pragma optimize does not support Os vincenzo.innocente at cern dot ch
  2012-06-26  8:43 ` [Bug middle-end/53776] " pinskia at gcc dot gnu.org
  2012-06-26  8:58 ` rguenth at gcc dot gnu.org
@ 2021-08-12  5:41 ` pinskia at gcc dot gnu.org
  2021-11-29  6:47 ` pinskia at gcc dot gnu.org
  2021-12-23  4:11 ` [Bug ipa/53776] " pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-12  5:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Looks fully fixed since GCC 8.1.0.

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

* [Bug middle-end/53776] pragma optimize does not support Os
  2012-06-26  8:15 [Bug middle-end/53776] New: pragma optimize does not support Os vincenzo.innocente at cern dot ch
                   ` (2 preceding siblings ...)
  2021-08-12  5:41 ` pinskia at gcc dot gnu.org
@ 2021-11-29  6:47 ` pinskia at gcc dot gnu.org
  2021-12-23  4:11 ` [Bug ipa/53776] " pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-29  6:47 UTC (permalink / raw)
  To: gcc-bugs

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

Bug 37565 Summary: __optimize__  attribute doesn't work correctly
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37565

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

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

* [Bug ipa/53776] pragma optimize does not support Os
  2012-06-26  8:15 [Bug middle-end/53776] New: pragma optimize does not support Os vincenzo.innocente at cern dot ch
                   ` (3 preceding siblings ...)
  2021-11-29  6:47 ` pinskia at gcc dot gnu.org
@ 2021-12-23  4:11 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-23  4:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |5.1.0, 8.1.0
   Target Milestone|---                         |8.0
          Component|middle-end                  |ipa
      Known to fail|                            |4.9.4
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 8 so closing.

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

end of thread, other threads:[~2021-12-23  4:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-26  8:15 [Bug middle-end/53776] New: pragma optimize does not support Os vincenzo.innocente at cern dot ch
2012-06-26  8:43 ` [Bug middle-end/53776] " pinskia at gcc dot gnu.org
2012-06-26  8:58 ` rguenth at gcc dot gnu.org
2021-08-12  5:41 ` pinskia at gcc dot gnu.org
2021-11-29  6:47 ` pinskia at gcc dot gnu.org
2021-12-23  4:11 ` [Bug ipa/53776] " 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).