This is the mail archive of the 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 ACATS failures in GCC 3.4

> Ahh!  Then I believe that its the code in fold that swaps commutative
> operands that's at fault.  I think those lines should be modified to
> read (around 5454 of fold-const.c):
>   if (commutative_tree_code (code)
>       && tree_swap_operands_p (arg0, arg1, true))
>     return fold (build (code, type, TREE_OPERAND (t, 1),
>                         TREE_OPERAND (t, 0)));
> i.e. using "TREE_OPERAND (t, x)" instead of "argx", and therefore
> avoiding the problematic loss of type conversions.

I don't think this is the correct fix (at least alone) since it only sweeps 
under the rug the problem of the dependency of the signedness of the 
comparison upon the operands.  I think that, from an Ada viewpoint, my fix 
is safer.

That said, you're the specialist of the constant folder so I may have 
overlooked many things.

> Could you try with this change (and reverting your proposed fix) and
> see if it also resolves the ACATS failures?

It most certainly will.

> Of course, you're probably right that there's also an issue with
> the MAX_EXPR and MIN_EXPR RTL expanders, and I'm now also curious
> why the nested NOPs above aren't being folded :>

The chain of NOPs is as follows:

<minus_expr 0x404be900
    type <integer_type 0x4017cbd0 long int sizetype SI

 arg 0 <nop_expr 0x404c067c type <integer_type 0x4017cbd0 long int>

  arg 0 <nop_expr 0x404c05dc type <integer_type 0x4017c438 integer>

   <var_decl 0x404bf72c R17b
    type <integer_type 0x404bf654 p__index___XDLU_0__100
        type <integer_type 0x4017c438 integer SI

Eric Botcazou

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