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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
          Component|ipa                         |c++
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot 
gnu.org
            Summary|[7/8/9 Regression] ICE:     |[7/8/9 Regression] ICE:
                   |Segmentation fault (in      |Segmentation fault (in
                   |make_ssa_name_fn)           |make_ssa_name_fn), C++ FE
                   |                            |missing DECL_EXPRs

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Program received signal SIGSEGV, Segmentation fault.
0x000000000174d104 in make_ssa_name_fn (fn=0x7ffff69e6160, var=<tree 0x0>, 
    stmt=<gimple 0x0>, version=0)
    at /space/rguenther/src/gcc-sccvn/gcc/tree-ssanames.c:268
268       gcc_assert (VAR_P (var)

we are remapping a released SSA name referenced from TYPE_SIZE of
int[0:(sizetype) D.2308][0:(sizetype) D.2307]

Thus this is a FE issue where we lack a DECL_EXPR for the type used in
some memory reference:

(gdb) p debug_gimple_stmt (stmt)
# VUSE <.MEM_6(D)>
_5 = MEM[(int[0:(sizetype) D.2308][0:(sizetype) D.2307] *)foo.2_4][0]{lb: 0 sz:
_3 * 4}[0];

static void f2 (int arg) { res = ((int (*)[arg][b]) foo)[0][0][0]; }

is in .original

;; Function void f2(int) (null)
;; enabled by -tree-original


<<cleanup_point <<< Unknown tree: expr_stmt
  (void) (res = (*(((sizetype) (SAVE_EXPR <(ssizetype) b + -1>) + 1) *
((sizetype) (SAVE_EXPR <(ssizetype) arg + -1>) + 1);, (int[0:(sizetype)
(SAVE_EXPR <(ssizetype) arg + -1>)][0:(sizetype) (SAVE_EXPR <(ssizetype) b +
-1>)] *) foo;))[0][0]) >>>>>;


there's no DECL_EXPR so size expressions are not properly unshared.  IIRC
there's a duplicate PR where I ran into a similar issue.  I'm probably
thinking of PR86216 which sadly also has no attention from FE maintainers.

Anyway, C++ FE bug.

Reply via email to