[patch] fix ice on comparison of aggregates with bitfield

Roger Sayle roger@eyesopen.com
Wed Jun 21 13:58:00 GMT 2006


Re: http://gcc.gnu.org/ml/gcc-patches/2006-05/msg00978.html
On Fri, 19 May 2006, Olivier Hainque wrote:
> 2006-05-19  Olivier Hainque  <hainque@adacore.com>
>
> 	* gimplify.c (gimplify_scalar_mode_aggregate_compare): New function.
> 	(gimplify_expr): Use it for tcc_comparison of operands of non BLKmode
> 	aggregate types.
>

This is OK for mainline with two changes.  Firstly, in your new function
gimplify_scalar_mode_aggregate_compare you should use fold_build1 and
fold_build2 instead of build1 and build2 respectively.  Now that fold
can simplify the VIEW_CONVERT_EXPR at compile-time, your new code can
easily be optimized to a compare of an integer constant at the tree-level.
Secondly, could you add the testcase from the above post, "procedure P2"
to the new GNAT testsuite.  You should probably confer with the other
Ada folks on a naming scheme for the new testsuite, and select a suitable
name for the new testcase.  Could you please confirm that the compiler
ICEs on the new testcase (i.e. it fails) without your patch, and passes
with it?

Thanks in advance,

Roger
--



More information about the Gcc-patches mailing list