[Bug middle-end/93576] [8 Regression] internal compiler error: Segmentation fault (in gimplify.c)

2020-02-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93576

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from Jakub Jelinek  ---
Fixed for 8.4+ too.

[Bug middle-end/93576] [8 Regression] internal compiler error: Segmentation fault (in gimplify.c)

2020-02-14 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93576

--- Comment #12 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:cd73697811f4d638a26be9aeada6eb20b645b739

commit r8-10021-gcd73697811f4d638a26be9aeada6eb20b645b739
Author: Jakub Jelinek 
Date:   Fri Feb 14 15:50:57 2020 +0100

c: Fix ICE with cast to VLA [93576]

The following testcase ICEs, because the PR84305 changes try to evaluate
the size earlier.  If size has side-effects, that is desirable, and the
side-effects will actually be wrapped in a SAVE_EXPR.  The problem on this
testcase is that there are no side-effects, and c_fully_fold doesn't fold
those COMPOUND_EXPRs to constant, and while before gimplification we
unshare
trees found in the expressions, the unsharing doesn't involve TYPE_SIZE
etc.
of used types.  Gimplification is destructive though, so when we gimplify
the two nested COMPOUND_EXPRs and then try to gimplify it the second time
for the TYPE_SIZEs, we ICE.
Now, we could use unshare_expr in what we push to *expr, SAVE_EXPRs and
their operands in there aren't unshared, but I really don't see a point of
evaluating expressions that don't have side-effects before, so instead
this just pushes there expressions that do have side-effects.

2020-02-13  Jakub Jelinek  

PR c/93576
* c-decl.c (grokdeclarator): If this_size_varies, only push size into
*expr if it has side effects.

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

[Bug middle-end/93576] [8 Regression] internal compiler error: Segmentation fault (in gimplify.c)

2020-02-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93576

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[8/9/10 Regression] |[8 Regression] internal
   |internal compiler error:|compiler error:
   |Segmentation fault (in  |Segmentation fault (in
   |gimplify.c) |gimplify.c)

--- Comment #11 from Jakub Jelinek  ---
Fixed for 9.3+ so far.