From 50f8ab99c8a05a9cf2fa7a50d475623c50123903 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 22 Jun 2018 23:11:28 +0200 Subject: [PATCH] backport: re PR rtl-optimization/85431 (UBSAN: ../../gcc/dse.c:303:15: runtime error: shift exponent 64 is too large for 64-bit type 'long unsigned int') Backported from mainline 2018-04-17 Jakub Jelinek PR rtl-optimization/85431 * dse.c (record_store): Ignore zero width stores. From-SVN: r261955 --- gcc/ChangeLog | 3 +++ gcc/dse.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 52232caf7a14..6be713635848 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,9 @@ Backported from mainline 2018-04-17 Jakub Jelinek + PR rtl-optimization/85431 + * dse.c (record_store): Ignore zero width stores. + PR target/85430 * config/i386/i386.md (*ashlqi3_1_slp): Use alu1 type instead of alu. diff --git a/gcc/dse.c b/gcc/dse.c index f87dd50024e8..174865bbc40b 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -1342,6 +1342,9 @@ record_store (rtx body, bb_info_t bb_info) else width = GET_MODE_SIZE (GET_MODE (mem)); + if (width == 0) + return 0; + if (group_id >= 0) { /* In the restrictive case where the base is a constant or the -- 2.47.2