[PATCH] Fix ICE in expand_shift
Jakub Jelinek
jakub@redhat.com
Fri Oct 27 12:42:00 GMT 2000
On Fri, Oct 27, 2000 at 10:51:47AM -0700, Mark Mitchell wrote:
> >>>>> "Richard" == Richard Henderson <rth@cygnus.com> writes:
>
> Richard> On Fri, Oct 27, 2000 at 04:07:06PM +0200, Jakub Jelinek
> Richard> wrote:
> >> The following testcase ICEs in expand_shift. The reason is that
> >> inlining on trees replaces y with 0x07 const_int and
> >> do_store_flag was passing VOIDmode to expand_shift.
>
> Richard> Seems to me that this should have been folded at the tree
> Richard> level when we had type info for the constant. Mark?
Actually, I think we're at the interface between tree level and rtx level at
that point, so the operand_mode I'm using there actually comes from
TYPE_MODE of the BIT_AND_EXPR.
Looking at how constants are handled in other cases (where gcc does not
ICE), say if the inline16.C the type of x is changed to int and body of
foo:a is x = y >> 1; then it is handled at the same place as I've patched:
expr.c at line 7746 in expand_expr calls:
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
return expand_shift (code, mode, op0, TREE_OPERAND (exp, 1), target,
unsignedp);
so actually the difference between do_store_flag code and this is only that
the mode in expand_expr does not come from op0 which is (const_int N).
>
> What platform does this fail on? It seems to pass on
> i686-pc-linux-gnu with -O1.
i386-pc-linux-gnu CVS gcc as of this morning (it is failing in the RH gcc as
well (based on 20000731) and has been failing before I updated from CVS this
morning as well.
./g++ -B ./ -O1 ../../gcc/testsuite/g++.old-deja/g++.other/inline16.C
../../gcc/testsuite/g++.old-deja/g++.other/inline16.C: In member function `void
foo::b()':
../../gcc/testsuite/g++.old-deja/g++.other/inline16.C:18: Internal compiler
error in expand_shift, at expmed.c:2031
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
Jakub
More information about the Gcc-patches
mailing list