[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

vries at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 22 06:44:00 GMT 2015


--- 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;

translates to:
  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. ]

More information about the Gcc-bugs mailing list