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]

[PATCH] Fix PR41273


Debug stmts shouldn't get vops, not even if we moved target mem-refs
in them.

Bootstrapped and tested on x86-64_unknwon-linux-gnu, applied to trunk.

Richard.

2009-09-05  Richard Guenther  <rguenther@suse.de>

	PR debug/41273
	* tree-ssa-operands.c (get_tmr_operands): Pass through opf_no_vops.

	* g++.dg/torture/pr41273.C: New testcase.

Index: gcc/tree-ssa-operands.c
===================================================================
*** gcc/tree-ssa-operands.c	(revision 151438)
--- gcc/tree-ssa-operands.c	(working copy)
*************** static void
*** 735,742 ****
  get_tmr_operands (gimple stmt, tree expr, int flags)
  {
    /* First record the real operands.  */
!   get_expr_operands (stmt, &TMR_BASE (expr), opf_use);
!   get_expr_operands (stmt, &TMR_INDEX (expr), opf_use);
  
    if (TMR_SYMBOL (expr))
      mark_address_taken (TMR_SYMBOL (expr));
--- 735,742 ----
  get_tmr_operands (gimple stmt, tree expr, int flags)
  {
    /* First record the real operands.  */
!   get_expr_operands (stmt, &TMR_BASE (expr), opf_use | (flags & opf_no_vops));
!   get_expr_operands (stmt, &TMR_INDEX (expr), opf_use | (flags & opf_no_vops));
  
    if (TMR_SYMBOL (expr))
      mark_address_taken (TMR_SYMBOL (expr));
Index: gcc/testsuite/g++.dg/torture/pr41273.C
===================================================================
*** gcc/testsuite/g++.dg/torture/pr41273.C	(revision 0)
--- gcc/testsuite/g++.dg/torture/pr41273.C	(revision 0)
***************
*** 0 ****
--- 1,18 ----
+ /* { dg-do compile } */
+ /* { dg-options "-g" } */
+ 
+ long *H2_ipX_ener_sort;
+ double H2_old_populations[2];
+ double H2_total;
+ 
+ void H2_LevelPops()
+ {
+   double sum_pop = 0.;
+   long nEner = 0;
+   while( nEner < 3 && sum_pop/H2_total < 0.99999 )
+     {
+       long ip = H2_ipX_ener_sort[nEner];
+       sum_pop += H2_old_populations[ip];
+       ++nEner;
+     }
+ }


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