Bug 21433 - The COMPONENT_REF case of expand_expr_real_1 is probably wrong
The COMPONENT_REF case of expand_expr_real_1 is probably wrong
Status: NEW
Product: gcc
Classification: Unclassified
Component: middle-end
unknown
: P2 normal
: ---
Assigned To: Not yet assigned to anyone
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-07 03:31 UTC by Kazu Hirata
Modified: 2012-01-20 02:37 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-01-19 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kazu Hirata 2005-05-07 03:31:00 UTC
We have the following coverage for the COMPONENT_REF case.

        -: 6997:    case COMPONENT_REF:
        -: 6998:      /* If the operand is a CONSTRUCTOR, we can just extract the
        -: 6999:	 appropriate field if it is present.  */
    75549: 7000:      if (TREE_CODE (TREE_OPERAND (exp, 0)) == CONSTRUCTOR)
        -: 7001:	{
        -: 7002:	  tree elt;
        -: 7003:
    #####: 7004:	  for (elt = CONSTRUCTOR_ELTS (TREE_OPERAND (exp, 0)); elt;
    #####: 7005:	       elt = TREE_CHAIN (elt))

I don't think we should expect a CONSTRUCTOR as the first operand
of EXP.  If TREE_OPERAND (exp, 0) is VAR_DECL, then we can expect
CONSTRUCTOR in DECL_INITIAL (TREE_OPERAND (exp, 0)).
Comment 1 Andrew Pinski 2005-05-07 15:52:25 UTC
(In reply to comment #0)
> We have the following coverage for the COMPONENT_REF case.
Actually I think at one point this was valid to do but that was before gimple and generic and tree-ssa.
I think the code is just dead now.
In fact this code dates before the EGCS split.