diff mbox

[resend] - Probable buglet in ipa-prop.c

Message ID 52967289.5070300@redhat.com
State New
Headers show

Commit Message

Andrew MacLeod Nov. 27, 2013, 10:30 p.m. UTC
On 11/27/2013 05:16 PM, Jeff Law wrote:
> On 11/27/13 14:30, Andrew MacLeod wrote:
>> mailer added html again...
>> ----------------------------------------
>>
>> When trying some of my updated prototype changes on trunk, the code
>> tripped over this segment in ipa-prop.c :
>>
>>         lhs = gimple_assign_lhs (stmt);
>>         rhs = gimple_assign_rhs1 (stmt);
>>         if (!is_gimple_reg_type (rhs)
>>             || TREE_CODE (lhs) == BIT_FIELD_REF
>>             || contains_bitfld_component_ref_p (lhs))
>>           break;
>>
>> I had converted "gimple_reg_type(tree)" to instead be "gimple_reg_type
>> (gimple_type)",  and during bootstrap it conked out because it received
>> an SSA_NAME instead of a type.
> Which probably caused everything after that conditional to be dead code.
>
>> I think it should probably be passing TREE_TYPE (rhs) liek so  ?
> Yup.  Agreed.  Feel free to submit the fix.  It'll be interested to 
> see how many of these we find as this work progresses.
>
> It'll also be interesting to see if there's any fallout from the 
> previously dead code now getting a chance to do something useful.
>
Just tripped over another one in tree-ssa-propagate.c:

I'll bootstrap the 2 of them together and run regressions overnight,  
and then check them in tomorrow, assuming thats OK.

Andrew

I only changed the 9 inline functions in gimple-expr.h which tripped 
over these 2 spots.  I was simply trying to bootstrap my prototype to 
make sure it interacted OK with the compiler  :-P

Comments

Andrew MacLeod Nov. 27, 2013, 10:31 p.m. UTC | #1
On 11/27/2013 05:30 PM, Andrew MacLeod wrote:
> On 11/27/2013 05:16 PM, Jeff Law wrote:
>> On 11/27/13 14:30, Andrew MacLeod wrote:
>>> mailer added html again...
>>> ----------------------------------------
>>>
>>> When trying some of my updated prototype changes on trunk, the code
>>> tripped over this segment in ipa-prop.c :
>>>
>>>         lhs = gimple_assign_lhs (stmt);
>>>         rhs = gimple_assign_rhs1 (stmt);
>>>         if (!is_gimple_reg_type (rhs)
>>>             || TREE_CODE (lhs) == BIT_FIELD_REF
>>>             || contains_bitfld_component_ref_p (lhs))
>>>           break;
>>>
>>> I had converted "gimple_reg_type(tree)" to instead be "gimple_reg_type
>>> (gimple_type)",  and during bootstrap it conked out because it received
>>> an SSA_NAME instead of a type.
>> Which probably caused everything after that conditional to be dead code.
>>
>>> I think it should probably be passing TREE_TYPE (rhs) liek so  ?
>> Yup.  Agreed.  Feel free to submit the fix.  It'll be interested to 
>> see how many of these we find as this work progresses.
>>
>> It'll also be interesting to see if there's any fallout from the 
>> previously dead code now getting a chance to do something useful.
>>
> Just tripped over another one in tree-ssa-propagate.c:
>
> I'll bootstrap the 2 of them together and run regressions overnight,  
> and then check them in tomorrow, assuming thats OK.
>
with of course that stupid white space corrected after TREE_TYPE :-P
Jeff Law Nov. 27, 2013, 10:51 p.m. UTC | #2
On 11/27/13 15:30, Andrew MacLeod wrote:
> On 11/27/2013 05:16 PM, Jeff Law wrote:
>> On 11/27/13 14:30, Andrew MacLeod wrote:
>>> mailer added html again...
>>> ----------------------------------------
>>>
>>> When trying some of my updated prototype changes on trunk, the code
>>> tripped over this segment in ipa-prop.c :
>>>
>>>         lhs = gimple_assign_lhs (stmt);
>>>         rhs = gimple_assign_rhs1 (stmt);
>>>         if (!is_gimple_reg_type (rhs)
>>>             || TREE_CODE (lhs) == BIT_FIELD_REF
>>>             || contains_bitfld_component_ref_p (lhs))
>>>           break;
>>>
>>> I had converted "gimple_reg_type(tree)" to instead be "gimple_reg_type
>>> (gimple_type)",  and during bootstrap it conked out because it received
>>> an SSA_NAME instead of a type.
>> Which probably caused everything after that conditional to be dead code.
>>
>>> I think it should probably be passing TREE_TYPE (rhs) liek so  ?
>> Yup.  Agreed.  Feel free to submit the fix.  It'll be interested to
>> see how many of these we find as this work progresses.
>>
>> It'll also be interesting to see if there's any fallout from the
>> previously dead code now getting a chance to do something useful.
>>
> Just tripped over another one in tree-ssa-propagate.c:
>
> I'll bootstrap the 2 of them together and run regressions overnight, and
> then check them in tomorrow, assuming thats OK.
Works for me.

jeff
diff mbox

Patch

	* tree-ssa-propagate.c (valid_gimple_call_p): Pass TREE_TYPE to 
	is_gimple_reg_type.

Index: tree-ssa-propagate.c
===================================================================
*** tree-ssa-propagate.c	(revision 205351)
--- tree-ssa-propagate.c	(working copy)
*************** valid_gimple_call_p (tree expr)
*** 667,673 ****
    for (i = 0; i < nargs; i++)
      {
        tree arg = CALL_EXPR_ARG (expr, i);
!       if (is_gimple_reg_type (arg))
  	{
  	  if (!is_gimple_val (arg))
  	    return false;
--- 667,673 ----
    for (i = 0; i < nargs; i++)
      {
        tree arg = CALL_EXPR_ARG (expr, i);
!       if (is_gimple_reg_type (TREE_TYPE(arg)))
  	{
  	  if (!is_gimple_val (arg))
  	    return false;