re PR target/65730 (xtensa: ICE in libstdc++-v3/include/bits/atomic_base.h: In functi...
authorMax Filippov <jcmvbkbc@gmail.com>
Wed, 20 May 2015 18:56:14 +0000 (18:56 +0000)
committerMax Filippov <jcmvbkbc@gcc.gnu.org>
Wed, 20 May 2015 18:56:14 +0000 (18:56 +0000)
Fix PR target/65730

2015-05-20  Max Filippov  <jcmvbkbc@gmail.com>
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
gcc/config/xtensa/xtensa.c

index 27435c675c5393a8f3ecf19060de3d6bcd945f02..36b8e05cf784aab29494e57acb8286ae7a9fd8e8 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-20  Max Filippov  <jcmvbkbc@gmail.com>
+
+       * 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  <law@redhat.com>
 
        * tree-ssa-threadupdate.c (mark_threaded_blocks): Properly
index 1e8ecebc3539c4e7b49180290d7198239471e99d..1f71117f4536e44a807dde1ad29cfa046af689cf 100644 (file)
@@ -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)),