public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103515] New: Unexpected OPTION_MASK_SAVE_TOC_INDIRECT of rs6000_isa_flag
@ 2021-12-01  8:19 linkw at gcc dot gnu.org
  2021-12-01  8:29 ` [Bug target/103515] " linkw at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: linkw at gcc dot gnu.org @ 2021-12-01  8:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103515
           Summary: Unexpected OPTION_MASK_SAVE_TOC_INDIRECT of
                    rs6000_isa_flag
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: linkw at gcc dot gnu.org
  Target Milestone: ---

Test case:
gcc/testsuite/g++.dg/torture/pr81360.C

Option:
-fno-early-inlining -Os

For function rs6000_can_inline_p, I tried to test if the rs6000_isa_flag is
always the same (expected) as the TREE_TARGET_OPTION
(target_option_default_node)->x_rs6000_isa_flags) when the caller_tree is NULL.

The regression testing on LE/BE showed up this failure. By investigating it, I
noticed it's a bug. Since the command line option is -Os, we should not set
this 
OPTION_MASK_SAVE_TOC_INDIRECT for most functions there:

  /* If we can shrink-wrap the TOC register save separately, then use
     -msave-toc-indirect unless explicitly disabled.  */
  if ((rs6000_isa_flags_explicit & OPTION_MASK_SAVE_TOC_INDIRECT) == 0
      && flag_shrink_wrap_separate
      && optimize_function_for_speed_p (cfun))
    rs6000_isa_flags |= OPTION_MASK_SAVE_TOC_INDIRECT;

But after compiler parsing the function main with "#pragma GCC optimize
("-O0")", the rs6000_isa_flags would always get this
OPTION_MASK_SAVE_TOC_INDIRECT on, even if the context is not for the function
main.

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

end of thread, other threads:[~2022-05-20  2:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01  8:19 [Bug target/103515] New: Unexpected OPTION_MASK_SAVE_TOC_INDIRECT of rs6000_isa_flag linkw at gcc dot gnu.org
2021-12-01  8:29 ` [Bug target/103515] " linkw at gcc dot gnu.org
2021-12-01  9:31 ` marxin at gcc dot gnu.org
2021-12-02  1:43 ` linkw at gcc dot gnu.org
2021-12-02  1:45 ` linkw at gcc dot gnu.org
2021-12-13  6:22 ` cvs-commit at gcc dot gnu.org
2022-05-19 21:46 ` bergner at gcc dot gnu.org
2022-05-20  2:06 ` linkw 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).