From 91767ed11af18ab39fc7a85850ff4908036e416b Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Wed, 20 May 2015 18:56:14 +0000 Subject: [PATCH] =?utf8?q?re=20PR=20target/65730=20(xtensa:=20ICE=20in=20l?= =?utf8?q?ibstdc++-v3/include/bits/atomic=5Fbase.h:=20In=20function=20?= =?utf8?q?=E2=80=98bool=20std::atomic=5Fflag=5Ftest=5Fand=5Fset=5Fexplicit?= =?utf8?q?(std::=5F=5Fatomic=5Fflag=5Fbase*,=20std::memory=5Forder)?= =?utf8?q?=E2=80=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix PR target/65730 2015-05-20 Max Filippov gcc/ * config/xtensa/xtensa.c (init_alignment_context): Replace MULT by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT). From-SVN: r223452 --- gcc/ChangeLog | 5 +++++ gcc/config/xtensa/xtensa.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 27435c675c5..36b8e05cf78 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-05-20 Max Filippov + + * config/xtensa/xtensa.c (init_alignment_context): Replace MULT + by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT). + 2015-05-20 Jeff Law * tree-ssa-threadupdate.c (mark_threaded_blocks): Properly diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 1e8ecebc353..1f71117f453 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1461,8 +1461,9 @@ init_alignment_context (struct alignment_context *ac, rtx mem) if (ac->shift != NULL_RTX) { /* Shift is the byte count, but we need the bitcount. */ - ac->shift = expand_simple_binop (SImode, MULT, ac->shift, - GEN_INT (BITS_PER_UNIT), + gcc_assert (exact_log2 (BITS_PER_UNIT) >= 0); + ac->shift = expand_simple_binop (SImode, ASHIFT, ac->shift, + GEN_INT (exact_log2 (BITS_PER_UNIT)), NULL_RTX, 1, OPTAB_DIRECT); ac->modemask = expand_simple_binop (SImode, ASHIFT, GEN_INT (GET_MODE_MASK (mode)), -- 2.30.2