Commit 97e9692b by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/19858 (ICE on simple SSE code)

	PR middle-end/19858
	* fold-const.c (make_bit_field_ref): If bitpos == 0 and bitsize
	is number of inner's bits, avoid creating a BIT_FIELD_REF.

	* gcc.c-torture/compile/20050210-1.c: New test.

From-SVN: r94892
parent 28f8ecf9
2005-02-11 Jakub Jelinek <jakub@redhat.com>
PR middle-end/19858
* fold-const.c (make_bit_field_ref): If bitpos == 0 and bitsize
is number of inner's bits, avoid creating a BIT_FIELD_REF.
* config/rs6000/sysv4.h (ENDFILE_LINUX_SPEC): Use crtendS.o instead of
crtend.o if -pie. Use %{x:a;:b} spec syntax.
......
......@@ -3076,8 +3076,20 @@ static tree
make_bit_field_ref (tree inner, tree type, int bitsize, int bitpos,
int unsignedp)
{
tree result = build3 (BIT_FIELD_REF, type, inner,
size_int (bitsize), bitsize_int (bitpos));
tree result;
if (bitpos == 0)
{
tree size = TYPE_SIZE (TREE_TYPE (inner));
if ((INTEGRAL_TYPE_P (TREE_TYPE (inner))
|| POINTER_TYPE_P (TREE_TYPE (inner)))
&& host_integerp (size, 0)
&& tree_low_cst (size, 0) == bitsize)
return fold_convert (type, inner);
}
result = build3 (BIT_FIELD_REF, type, inner,
size_int (bitsize), bitsize_int (bitpos));
BIT_FIELD_REF_UNSIGNED (result) = unsignedp;
......
2005-02-11 Jakub Jelinek <jakub@redhat.com>
PR middle-end/19858
* gcc.c-torture/compile/20050210-1.c: New test.
2005-02-11 Mark Mitchell <mark@codesourcery.com>
PR c++/19755
......
/* PR middle-end/19858 */
typedef __SIZE_TYPE__ size_t;
union U { int c; } foo;
int bar (void)
{
return !(((size_t) &foo & 3) == 0 && !((size_t) &foo & 1));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment