This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/65818] [6 Regression] libiberty/vprintf-support.c:41:1: ICE: in expand_i fn_va_arg_1, at tree-stdarg.c:1095
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Apr 2015 06:44:01 +0000
- Subject: [Bug tree-optimization/65818] [6 Regression] libiberty/vprintf-support.c:41:1: ICE: in expand_i fn_va_arg_1, at tree-stdarg.c:1095
- Auto-submitted: auto-generated
- References: <bug-65818-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65818
--- Comment #3 from vries at gcc dot gnu.org ---
The code snippet:
...
case 'f':
case 'e':
case 'E':
case 'g':
case 'G':
(void) __builtin_va_arg(ap, double);
total_width += 307;
break;
...
translates to:
...
<L23>:
VA_ARG (&ap, 0B);
total_width_70 = total_width_31 + 337;
# DEBUG total_width => total_width_70
goto <bb 21> (<L31>);
...
at the end of hppa_gimplify_va_arg_expr, the result looks like:
...
(gdb) p *pre_p
$2 = (gimple_seq) 0x0
(gdb) p *post_p
$3 = (gimple_seq) 0x0
(gdb) call debug_generic_expr (t)
*(double *) (ap = ap + 4294967288 & 4294967288B)
...
Note that pre_p and post_p are empty, and t contains the side-effect of
assigning to ap.
Since ifn_va_arg has no lhs, the returned value is not assigned to any var in
expand_ifn_va_arg_1, and the side-effect is lost.
We need to further gimplify the expression to fix the error. [ I wonder whether
that's the responsibility of TARGET_GIMPLIFY_VA_ARG_EXPR. ]