This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR middle-end/17793


    What can I say except "please read the patch"?  It turns

      ADDR_EXPR <pointer_type <record_type>>
        VIEW_CONVERT_EXPR <record_type>
          NOP_EXPR <integer_type1>
            ARRAY_REF <integer_type2>

    into
    
      NOP_EXPR <pointer_type <record_type>
        NOP_EXPR <pointer_type <integer_type1>
          ADDR_EXPR <pointer_type <integer_type2>>
            ARRAY_REF <integer_type2>

I don't ever recall seeing the nest like that and I don't understand
why it has to be handled separately.

I'd expect that original to be first transformed to:

      NOP_EXPR <pointer_type <record_type>>
	ADDR_EXPR <pointer_type <integer_type1>>
          NOP_EXPR <integer_type1>
            ARRAY_REF <integer_type2>

Then we'd go back and process the ADDR_EXPR again and do the same
thing (if valid, meaning if the size isn't changing or it is and the
endianness is right).  But you don't need to look inside the
VIEW_CONVERT_EXPR to do that.

Moreover, you don't need the two NOP_EXPRs in the result: one is enough.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]