------- Comment #5 from rguenth at gcc dot gnu dot org 2006-05-04 15:25 -------
The problem with 4.0 is that the CALL_EXPR uses the return slot address to
return, but we don't honour that.
Index: c-common.c
===================================================================
*** c-common.c (revision 113528)
--- c-common.c (working copy)
*************** c_warn_unused_result (tree *top_p)
*** 5658,5664 ****
break;
case CALL_EXPR:
! if (TREE_USED (t))
break;
/* This is a naked call, as opposed to a CALL_EXPR nested inside
--- 5658,5665 ----
break;
case CALL_EXPR:
! if (TREE_USED (t)
! || CALL_EXPR_HAS_RETURN_SLOT_ADDR (t))
break;
/* This is a naked call, as opposed to a CALL_EXPR nested inside
though this makes PR27371 also fail for 4.0, as 4.0 shares the same problem
of always emitting the "useless store".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27370