On 12/09/13 04:16, Eric Botcazou wrote:
Hi,
the new test gnat.dg/pack19.adb doesn't pass on some platforms because of the
target-dependent result of loads from bit-fields with size 0.
Unlike the stores to these bit-fields which are handled in an uniform way in
store_field:
/* If we have nothing to store, do nothing unless the expression has
side-effects. */
if (bitsize == 0)
return expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
the result of the loads depends on SHIFT_COUNT_TRUNCATED: the result is 0 if
the macro is 0, otherwise it's garbage. The attached patch makes it so that
the result is always 0 independently of the target.
Tested on x86/Linux and PowerPC/Linux, OK for the mainline?
2013-12-09 Eric Botcazou <ebotca...@adacore.com>
* expr.c (expand_expr_real_1) <normal_inner_ref>: Always return 0 for
the extraction of a bit-field of null size.
But isn't the test bogus if it depends on the result of loading a zero
sized bitfield?
Jeff