This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ACATS failures in GCC 3.4
- From: Eric Botcazou <ebotcazou at act-europe dot fr>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 26 Feb 2004 11:32:32 +0100
- Subject: Re: [PATCH] Fix ACATS failures in GCC 3.4
- References: <Pine.LNX.4.44.0402251325460.31030-100000@www.eyesopen.com>
> 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