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 for PR 12072 (set constants generate wrong code)


> 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


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