public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/104381] New: [12 Regression] -gtoggle no longer applied when using optimize attribute
@ 2022-02-04 12:36 rguenth at gcc dot gnu.org
  2022-02-04 12:36 ` [Bug middle-end/104381] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-04 12:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104381
           Summary: [12 Regression] -gtoggle no longer applied when using
                    optimize attribute
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

int foo (int x)
{
  int tem = x + 1;
  int tem2 = tem - 1;
  return tem2;
}

int __attribute__((optimize("no-tree-pre"))) bar (int x)
{
  int tem = x + 1;
  int tem2 = tem - 1;
  return tem2;
}

with

> ./xgcc -B. t.c -O2 -g -gtoggle -fdump-tree-optimized -c

I get

;; Function foo (foo, funcdef_no=0, decl_uid=1979, cgraph_uid=1,
symbol_order=0)

int foo (int x)
{
  <bb 2> [local count: 1073741824]:
  return x_1(D);

}



;; Function bar (bar, funcdef_no=1, decl_uid=1984, cgraph_uid=2,
symbol_order=1)

__attribute__((optimize ("no-tree-pre")))
int bar (int x)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG tem => x_1(D) + 1
  # DEBUG tem2 => x_1(D)
  return x_1(D);

}

so -gtoggle is not applied to 'bar'.  This works fine with GCC 11.

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

end of thread, other threads:[~2022-03-07 14:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 12:36 [Bug middle-end/104381] New: [12 Regression] -gtoggle no longer applied when using optimize attribute rguenth at gcc dot gnu.org
2022-02-04 12:36 ` [Bug middle-end/104381] " rguenth at gcc dot gnu.org
2022-02-04 12:44 ` rguenth at gcc dot gnu.org
2022-02-04 13:00 ` [Bug middle-end/104381] [12 Regression] -gtoggle no longer applied when using optimize attribute since r12-4608-gb4702276615ff8d4 marxin at gcc dot gnu.org
2022-02-28  9:17 ` marxin at gcc dot gnu.org
2022-03-07 14:45 ` cvs-commit at gcc dot gnu.org
2022-03-07 14:47 ` marxin 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).