Commit ae3df2dc by Eric Botcazou Committed by Eric Botcazou

expr.c (expand_expr_real_1): Always return 0 for the extraction of a bit-field of null size.

	* expr.c (expand_expr_real_1) <normal_inner_ref>: Always return 0 for
	the extraction of a bit-field of null size.

From-SVN: r205855
parent ed9e19a4
2013-12-10 Eric Botcazou <ebotcazou@adacore.com>
* expr.c (expand_expr_real_1) <normal_inner_ref>: Always return 0 for
the extraction of a bit-field of null size.
2013-12-10 Marek Polacek <polacek@redhat.com>
PR sanitizer/59437
......@@ -10157,6 +10157,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (target == 0)
target = assign_temp (type, 1, 1);
/* ??? Unlike the similar test a few lines below, this one is
very likely obsolete. */
if (bitsize == 0)
return target;
......@@ -10177,6 +10179,13 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return target;
}
/* If we have nothing to extract, the result will be 0 for targets
with SHIFT_COUNT_TRUNCATED == 0 and garbage otherwise. Always
return 0 for the sake of consistency, as reading a zero-sized
bitfield is valid in Ada and the value is fully specified. */
if (bitsize == 0)
return const0_rtx;
op0 = validize_mem (op0);
if (MEM_P (op0) && REG_P (XEXP (op0, 0)))
......
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