diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2013-12-10 11:07:28 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2013-12-10 11:07:28 +0000 |
commit | ae3df2dc0a108b120304fe7725f58efc316fdd9a (patch) | |
tree | 7662eb21d49d1698fcaf48e012c2443104249515 /gcc/expr.c | |
parent | ed9e19a494a43647159b156737c55bde8ebf3c59 (diff) | |
download | gcc-ae3df2dc0a108b120304fe7725f58efc316fdd9a.zip gcc-ae3df2dc0a108b120304fe7725f58efc316fdd9a.tar.gz gcc-ae3df2dc0a108b120304fe7725f58efc316fdd9a.tar.bz2 |
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
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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))) |