public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/109644] New: Missing GIMPLE IL verification
@ 2023-04-27  8:41 rguenth at gcc dot gnu.org
  2023-04-27  8:43 ` [Bug middle-end/109644] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-27  8:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109644
           Summary: Missing GIMPLE IL verification
           Product: gcc
           Version: 14.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: ---

We are missing GIMPLE IL verification of handled component operations on
registers.  There's only a subset of operations allowed and they should
not stack but behave like UNARY ops.  The subset allowed is
REALPART_EXPR, IMAGPART_EXPR, VIEW_CONVERT_EXPR and BIT_FIELD_REF.  In
particular ops that require aggregate types such as ARRAY_REF and COMPONENT_REF
are not allowed, but the missing IL verification makes those sneak through
with the register wrapped in a VIEW_CONVERT_EXPR producing the aggregate type.

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

* [Bug middle-end/109644] Missing GIMPLE IL verification
  2023-04-27  8:41 [Bug middle-end/109644] New: Missing GIMPLE IL verification rguenth at gcc dot gnu.org
@ 2023-04-27  8:43 ` rguenth at gcc dot gnu.org
  2023-04-27 10:31 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-27  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-04-27

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 54936
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54936&action=edit
patch implementing the IL verification

This implements appropriate IL verification, but it currently runs into quite
some issues where we create invalid GIMPLE.

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

* [Bug middle-end/109644] Missing GIMPLE IL verification
  2023-04-27  8:41 [Bug middle-end/109644] New: Missing GIMPLE IL verification rguenth at gcc dot gnu.org
  2023-04-27  8:43 ` [Bug middle-end/109644] " rguenth at gcc dot gnu.org
@ 2023-04-27 10:31 ` rguenth at gcc dot gnu.org
  2023-04-28  9:49 ` cvs-commit at gcc dot gnu.org
  2023-04-28  9:49 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-27 10:31 UTC (permalink / raw)
  To: gcc-bugs

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

Bug 109607 Summary: IPA replaces stmt with invalid gimple
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109607

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

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

* [Bug middle-end/109644] Missing GIMPLE IL verification
  2023-04-27  8:41 [Bug middle-end/109644] New: Missing GIMPLE IL verification rguenth at gcc dot gnu.org
  2023-04-27  8:43 ` [Bug middle-end/109644] " rguenth at gcc dot gnu.org
  2023-04-27 10:31 ` rguenth at gcc dot gnu.org
@ 2023-04-28  9:49 ` cvs-commit at gcc dot gnu.org
  2023-04-28  9:49 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-28  9:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:6e6f86f22873aab7059e083fd0c9905bd58e5efa

commit r14-324-g6e6f86f22873aab7059e083fd0c9905bd58e5efa
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Apr 24 13:20:25 2023 +0200

    tree-optimization/109644 - missing IL checking

    We fail to verify the constraints under which we allow handled
    components to wrap registers.  The gcc.dg/pr70022.c testcase shows
    that we happily end up with

      _2 = VIEW_CONVERT_EXPR<int[4]>(v_1(D))

    as produced by SSA rewrite and update_address_taken.  But the intent
    was that we wrap registers with at most a single level of handled
    components and specifically only allow __real, __imag, BIT_FIELD_REF
    and VIEW_CONVERT_EXPR on them, but not ARRAY_REF or COMPONENT_REF.

    The following makes IL verification stricter which catches the
    problem.

            PR tree-optimization/109644
            * tree-cfg.cc (verify_types_in_gimple_reference): Check
            register constraints on the outermost VIEW_CONVERT_EXPR
            only.  Do not allow register or invariant bases on
            multi-level or possibly variable index handled components.

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

* [Bug middle-end/109644] Missing GIMPLE IL verification
  2023-04-27  8:41 [Bug middle-end/109644] New: Missing GIMPLE IL verification rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-04-28  9:49 ` cvs-commit at gcc dot gnu.org
@ 2023-04-28  9:49 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-28  9:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
The desired IL verification is now implemented.  I'm going to watch the
inevitable fireworks.

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

end of thread, other threads:[~2023-04-28  9:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27  8:41 [Bug middle-end/109644] New: Missing GIMPLE IL verification rguenth at gcc dot gnu.org
2023-04-27  8:43 ` [Bug middle-end/109644] " rguenth at gcc dot gnu.org
2023-04-27 10:31 ` rguenth at gcc dot gnu.org
2023-04-28  9:49 ` cvs-commit at gcc dot gnu.org
2023-04-28  9:49 ` rguenth 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).