[Bug optimization/12268] New: Miscompilation of fortran/match.c

Diego Novillo dnovillo@redhat.com
Sat Sep 13 23:45:00 GMT 2003


On Sat, 2003-09-13 at 11:32, pbrook at gcc dot gnu dot org wrote:

> The following testcase fails when compiled with -O. Somewhere along the line 
> the assignment in test() gets removed. Code derived from fortran/match.c. 
>
This patch ought to fix it.  We were not registering the fact that
call-clobbered pointers may end up pointing to global memory.

Bootstrap and tests in progress.  Will commit afterwards.


Diego.

	* tree-dfa.c (add_referenced_var): Call-clobbered pointers may
	point to global memory.

Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.158
diff -d -c -p -r1.1.4.158 tree-dfa.c
*** tree-dfa.c	13 Sep 2003 20:21:26 -0000	1.1.4.158
--- tree-dfa.c	13 Sep 2003 23:37:16 -0000
*************** add_referenced_var (tree var, struct wal
*** 2551,2556 ****
--- 2551,2558 ----
  	{
  	  add_call_clobbered_var (var);
  	  v_ann->is_call_clobbered = 1;
+ 	  if (POINTER_TYPE_P (TREE_TYPE (var)))
+ 	    v_ann->may_point_to_global_mem = 1;
  	}
      }



More information about the Gcc-patches mailing list