public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/98525] New: potential error in expand_call_inline error handling
@ 2021-01-05  9:44 bernd.edlinger at hotmail dot de
  2021-01-05 10:46 ` [Bug middle-end/98525] " marxin at gcc dot gnu.org
  2021-12-11  7:51 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: bernd.edlinger at hotmail dot de @ 2021-01-05  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98525
           Summary: potential error in expand_call_inline error handling
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bernd.edlinger at hotmail dot de
  Target Milestone: ---

The error handling in the following if-statement is possibly broken

tree-inline.c:
   /* If callee is thunk, all we need is to adjust the THIS pointer
      and redirect to function being thunked.  */
   if (id->src_node->thunk)
   {
      ...
      expand_call_inline (bb, stmt, id, to_purge);
      maybe_remove_unused_call_args (cfun, stmt);
      return true;
   }

The return value of the recursive expand_call_inline
is ignored, and instead we always return true here.

BUT the inline function is not always successfully
expanded here.

At least in the following test cases, the expansion of the
inline call fails, but it is unclear if the IL is already modified
in preparation of a successful inlining:

+FAIL: g++.dg/ipa/devirt-5.C  -std=gnu++98 (internal compiler error)
+FAIL: g++.dg/ipa/devirt-5.C  -std=gnu++98 (test for excess errors)
+UNRESOLVED: g++.dg/ipa/devirt-5.C  -std=gnu++98 compilation failed to produce
executable
+FAIL: g++.dg/ipa/devirt-5.C  -std=gnu++14 (internal compiler error)
+FAIL: g++.dg/ipa/devirt-5.C  -std=gnu++14 (test for excess errors)
+UNRESOLVED: g++.dg/ipa/devirt-5.C  -std=gnu++14 compilation failed to produce
executable
+FAIL: g++.dg/ipa/devirt-5.C  -std=gnu++17 (internal compiler error)
+FAIL: g++.dg/ipa/devirt-5.C  -std=gnu++17 (test for excess errors)
+UNRESOLVED: g++.dg/ipa/devirt-5.C  -std=gnu++17 compilation failed to produce
executable
+FAIL: g++.dg/ipa/devirt-5.C  -std=gnu++2a (internal compiler error)
+FAIL: g++.dg/ipa/devirt-5.C  -std=gnu++2a (test for excess errors)
+UNRESOLVED: g++.dg/ipa/devirt-5.C  -std=gnu++2a compilation failed to produce
executable
+FAIL: g++.dg/ipa/devirt-c-4.C  -std=gnu++98 (internal compiler error)
+FAIL: g++.dg/ipa/devirt-c-4.C  -std=gnu++98 (test for excess errors)
+UNRESOLVED: g++.dg/ipa/devirt-c-4.C  -std=gnu++98 compilation failed to
produce executable
+FAIL: g++.dg/ipa/devirt-c-4.C  -std=gnu++14 (internal compiler error)
+FAIL: g++.dg/ipa/devirt-c-4.C  -std=gnu++14 (test for excess errors)
+UNRESOLVED: g++.dg/ipa/devirt-c-4.C  -std=gnu++14 compilation failed to
produce executable
+FAIL: g++.dg/ipa/devirt-c-4.C  -std=gnu++17 (internal compiler error)
+FAIL: g++.dg/ipa/devirt-c-4.C  -std=gnu++17 (test for excess errors)
+UNRESOLVED: g++.dg/ipa/devirt-c-4.C  -std=gnu++17 compilation failed to
produce executable
+FAIL: g++.dg/ipa/devirt-c-4.C  -std=gnu++2a (internal compiler error)
+FAIL: g++.dg/ipa/devirt-c-4.C  -std=gnu++2a (test for excess errors)
+UNRESOLVED: g++.dg/ipa/devirt-c-4.C  -std=gnu++2a compilation failed to
produce executable
+FAIL: g++.dg/ipa/imm-devirt-2.C  -std=gnu++98 (internal compiler error)
+FAIL: g++.dg/ipa/imm-devirt-2.C  -std=gnu++98 (test for excess errors)
+UNRESOLVED: g++.dg/ipa/imm-devirt-2.C  -std=gnu++98 compilation failed to
produce executable
+FAIL: g++.dg/ipa/imm-devirt-2.C  -std=gnu++14 (internal compiler error)
+FAIL: g++.dg/ipa/imm-devirt-2.C  -std=gnu++14 (test for excess errors)
+UNRESOLVED: g++.dg/ipa/imm-devirt-2.C  -std=gnu++14 compilation failed to
produce executable
+FAIL: g++.dg/ipa/imm-devirt-2.C  -std=gnu++17 (internal compiler error)
+FAIL: g++.dg/ipa/imm-devirt-2.C  -std=gnu++17 (test for excess errors)
+UNRESOLVED: g++.dg/ipa/imm-devirt-2.C  -std=gnu++17 compilation failed to
produce executable
+FAIL: g++.dg/ipa/imm-devirt-2.C  -std=gnu++2a (internal compiler error)
+FAIL: g++.dg/ipa/imm-devirt-2.C  -std=gnu++2a (test for excess errors)
+UNRESOLVED: g++.dg/ipa/imm-devirt-2.C  -std=gnu++2a compilation failed to
produce executable
+FAIL: g++.dg/ipa/pr71146.C  -std=gnu++98 (internal compiler error)
+FAIL: g++.dg/ipa/pr71146.C  -std=gnu++98 (test for excess errors)
+FAIL: g++.dg/ipa/pr71146.C  -std=gnu++14 (internal compiler error)
+FAIL: g++.dg/ipa/pr71146.C  -std=gnu++14 (test for excess errors)
+FAIL: g++.dg/ipa/pr71146.C  -std=gnu++17 (internal compiler error)
+FAIL: g++.dg/ipa/pr71146.C  -std=gnu++17 (test for excess errors)
+FAIL: g++.dg/ipa/pr71146.C  -std=gnu++2a (internal compiler error)
+FAIL: g++.dg/ipa/pr71146.C  -std=gnu++2a (test for excess errors)
+FAIL: g++.dg/ipa/pr79776.C  -std=gnu++98 (internal compiler error)
+FAIL: g++.dg/ipa/pr79776.C  -std=gnu++98 (test for excess errors)
+FAIL: g++.dg/ipa/pr79776.C  -std=gnu++14 (internal compiler error)
+FAIL: g++.dg/ipa/pr79776.C  -std=gnu++14 (test for excess errors)
+FAIL: g++.dg/ipa/pr79776.C  -std=gnu++17 (internal compiler error)
+FAIL: g++.dg/ipa/pr79776.C  -std=gnu++17 (test for excess errors)
+FAIL: g++.dg/ipa/pr79776.C  -std=gnu++2a (internal compiler error)
+FAIL: g++.dg/ipa/pr79776.C  -std=gnu++2a (test for excess errors)
+FAIL: g++.dg/ipa/pr85421.C   (internal compiler error)
+FAIL: g++.dg/ipa/pr85421.C   (test for excess errors)
+FAIL: g++.dg/ipa/pr91969.C  -std=gnu++98 (internal compiler error)
+FAIL: g++.dg/ipa/pr91969.C  -std=gnu++98 (test for excess errors)
+FAIL: g++.dg/ipa/pr91969.C  -std=gnu++14 (internal compiler error)
+FAIL: g++.dg/ipa/pr91969.C  -std=gnu++14 (test for excess errors)
+FAIL: g++.dg/ipa/pr91969.C  -std=gnu++17 (internal compiler error)
+FAIL: g++.dg/ipa/pr91969.C  -std=gnu++17 (test for excess errors)
+FAIL: g++.dg/ipa/pr91969.C  -std=gnu++2a (internal compiler error)
+FAIL: g++.dg/ipa/pr91969.C  -std=gnu++2a (test for excess errors)
+FAIL: g++.dg/ipa/pr92454.C  -std=gnu++98 (internal compiler error)
+FAIL: g++.dg/ipa/pr92454.C  -std=gnu++98 (test for excess errors)
+FAIL: g++.dg/ipa/pr92454.C  -std=gnu++14 (internal compiler error)
+FAIL: g++.dg/ipa/pr92454.C  -std=gnu++14 (test for excess errors)
+FAIL: g++.dg/ipa/pr92454.C  -std=gnu++17 (internal compiler error)
+FAIL: g++.dg/ipa/pr92454.C  -std=gnu++17 (test for excess errors)
+FAIL: g++.dg/ipa/pr92454.C  -std=gnu++2a (internal compiler error)
+FAIL: g++.dg/ipa/pr92454.C  -std=gnu++2a (test for excess errors)
 FAIL: g++.dg/guality/pr55665.C   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  line 23 p == 40
+FAIL: g++.dg/lto/devirt-5 cp_lto_devirt-5_0.o-cp_lto_devirt-5_0.o link, -O3
-fno-early-inlining -fno-inline -fdump-ipa-cp -fdump-tree-optimized -flto
(internal compiler error)

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

* [Bug middle-end/98525] potential error in expand_call_inline error handling
  2021-01-05  9:44 [Bug middle-end/98525] New: potential error in expand_call_inline error handling bernd.edlinger at hotmail dot de
@ 2021-01-05 10:46 ` marxin at gcc dot gnu.org
  2021-12-11  7:51 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-05 10:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2021-01-05
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

* [Bug middle-end/98525] potential error in expand_call_inline error handling
  2021-01-05  9:44 [Bug middle-end/98525] New: potential error in expand_call_inline error handling bernd.edlinger at hotmail dot de
  2021-01-05 10:46 ` [Bug middle-end/98525] " marxin at gcc dot gnu.org
@ 2021-12-11  7:51 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-11  7:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
      successfully_inlined = expand_call_inline (bb, stmt, id, to_purge);
      maybe_remove_unused_call_args (cfun, stmt);
      /* This used to return true even though we do fail to inline in
         some cases.  See PR98525.  */
      goto egress;


Since it is not so obvious from reading the code and even reading this bug
report (but it was clear from the mailing list), the suggestion was to add an
assert that successfully_inlined was true and the failures in comment #0 happen
when the assert is added in the above code.

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05  9:44 [Bug middle-end/98525] New: potential error in expand_call_inline error handling bernd.edlinger at hotmail dot de
2021-01-05 10:46 ` [Bug middle-end/98525] " marxin at gcc dot gnu.org
2021-12-11  7:51 ` 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).