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

* [Bug middle-end/104381] [12 Regression] -gtoggle no longer applied when using optimize attribute
  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 ` rguenth at gcc dot gnu.org
  2022-02-04 12:44 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
                 CC|                            |marxin at gcc dot gnu.org

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

* [Bug middle-end/104381] [12 Regression] -gtoggle no longer applied when using optimize attribute
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-04 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Err, it's worse(?)

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

;; 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 it either applies -gtoggle or somehow enables at least
var-tracking-assignments (no .debug_info generated).

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

* [Bug middle-end/104381] [12 Regression] -gtoggle no longer applied when using optimize attribute since r12-4608-gb4702276615ff8d4
  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 ` marxin at gcc dot gnu.org
  2022-02-28  9:17 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-02-04 13:00 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-02-04
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org
            Summary|[12 Regression] -gtoggle no |[12 Regression] -gtoggle no
                   |longer applied when using   |longer applied when using
                   |optimize attribute          |optimize attribute since
                   |                            |r12-4608-gb4702276615ff8d4
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-4608-gb4702276615ff8d4, working on that.

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

* [Bug middle-end/104381] [12 Regression] -gtoggle no longer applied when using optimize attribute since r12-4608-gb4702276615ff8d4
  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
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-02-28  9:17 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
*** Bug 104705 has been marked as a duplicate of this bug. ***

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

* [Bug middle-end/104381] [12 Regression] -gtoggle no longer applied when using optimize attribute since r12-4608-gb4702276615ff8d4
  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
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-07 14:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:111754595cf8d3a8ae7063a42ac4cea18a304711

commit r12-7521-g111754595cf8d3a8ae7063a42ac4cea18a304711
Author: Martin Liska <mliska@suse.cz>
Date:   Fri Feb 4 15:50:17 2022 +0100

    opts: fix -gtoggle + optimize attribute

    Note -fvar-tracking is enabled automatically with OPT_LEVELS_1_PLUS and
    so we need to drop it if we are called from optimize attribute and the
    option is unset.

            PR middle-end/104381

    gcc/ChangeLog:

            * opts.cc (finish_options): If debug info is disabled
            (debug_info_level) and -fvar-tracking is unset, disable it.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pr104381.c: New test.

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

* [Bug middle-end/104381] [12 Regression] -gtoggle no longer applied when using optimize attribute since r12-4608-gb4702276615ff8d4
  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
                   ` (4 preceding siblings ...)
  2022-03-07 14:45 ` cvs-commit at gcc dot gnu.org
@ 2022-03-07 14:47 ` marxin at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-03-07 14:47 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

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

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed.

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