http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58346

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #1 from Mikael Pettersson <mikpe at it dot uu.se> ---
Crashes with division-by-zero in the exact same spot as the PR58345 test case
does.  However this test case also crashes 4.7 and 4.6.

Program received signal SIGFPE, Arithmetic exception.
0x00000000005e2448 in fold_array_ctor_reference (ctor=0x7ffff7627ca8,
ctor=0x7ffff7627ca8, from_decl=0x7ffff7535be0, size=0, offset=0,
type=0x7ffff7645540)
    at /mnt/scratch/gcc-4.9-20130901/gcc/gimple-fold.c:2816
2816      inner_offset = offset % (elt_size.to_uhwi () * BITS_PER_UNIT);
(gdb) list
2811      if (index_type)
2812        access_index = access_index.ext (TYPE_PRECISION (index_type),
2813                                         TYPE_UNSIGNED (index_type));
2814
2815      /* And offset within the access.  */
2816      inner_offset = offset % (elt_size.to_uhwi () * BITS_PER_UNIT);
2817
2818      /* See if the array field is large enough to span whole access.  We
do not
2819         care to fold accesses spanning multiple array indexes.  */
2820      if (inner_offset + size > elt_size.to_uhwi () * BITS_PER_UNIT)
(gdb) print elt_size
$1 = {low = 0, high = 0}
(gdb) q

Reply via email to