This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for PR 12072 (set constants generate wrong code)
- From: Josef Zlomek <zlomj9am at artax dot karlin dot mff dot cuni dot cz>
- To: Waldek Hebisch <hebisch at math dot uni dot wroc dot pl>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 2 Oct 2003 16:45:48 +0200
- Subject: Re: Patch for PR 12072 (set constants generate wrong code)
- References: <E19sPiA-00008n-00@hera.math.uni.wroc.pl>
> In gcc-3.3.1 set constants may be compiled incorrectly -- backend
> tries to emit identical constants only once, however in the
> test for equality the result is reversed (so two constant
> are unified when hashes are equal and constants are not equal).
> The problem affects GNU Pascal (IMHO "standard" frontends do not use
> sets so problem can not be reproduced with them). The patch below
> fixes the problem. Tested on i686-pc-linux-gnu (bootstraped gcc+gpc).
>
>
> ChangeLog:
> * fixes PR middle-end/12072 (set constants generate wrong code)
>
> *** gcc-3.3.1.orig/gcc/varasm.c Thu Jul 24 21:11:26 2003
> --- gcc-3.3.1/gcc/varasm.c Wed Aug 27 23:45:47 2003
> *************** compare_constant (t1, t2)
> *** 2411,2417 ****
> if (get_set_constructor_bytes (t2, tmp2, len) != NULL_TREE)
> return 0;
>
> ! return memcmp (tmp1, tmp2, len) != 0;
> }
> else
> {
> --- 2411,2417 ----
> if (get_set_constructor_bytes (t2, tmp2, len) != NULL_TREE)
> return 0;
>
> ! return memcmp (tmp1, tmp2, len) == 0;
> }
> else
> {
2003-10-02 Josef Zlomek <zlomekj@suse.cz>
Waldek Hebisch <hebisch@math.uni.wroc.pl>
PR/12072
* varasm.c (compare_constant): Fix thinko.
I'm commiting it as obvoius.
Josef