https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89091
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Fri Aug 30 12:08:04 2019 New Revision: 275117 URL: https://gcc.gnu.org/viewcvs?rev=275117&root=gcc&view=rev Log: Backported from mainline 2019-02-20 Jakub Jelinek <ja...@redhat.com> David Malcolm <dmalc...@redhat.com> PR middle-end/89091 * fold-const.c (decode_field_reference): Return NULL_TREE if lang_hooks.types.type_for_size returns NULL. Check it before overwriting *exp_. Use return NULL_TREE instead of return 0. * gcc.dg/torture/pr89091.c: New test. Added: branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr89091.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/fold-const.c branches/gcc-7-branch/gcc/testsuite/ChangeLog