[Bug middle-end/49671] [4.6/4.7 Regression] volatile goes missing after inlining

2011-07-26 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49671

Andrew Pinski  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #7 from Andrew Pinski  2011-07-26 
07:53:25 UTC ---
Fixed.


[Bug middle-end/49671] [4.6/4.7 Regression] volatile goes missing after inlining

2011-07-26 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49671

--- Comment #6 from Andrew Pinski  2011-07-26 
07:52:27 UTC ---
Author: pinskia
Date: Tue Jul 26 07:52:24 2011
New Revision: 176785

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176785
Log:
2011-07-25  Andrew Pinski  

PR tree-opt/49671
* tree-inline.c (remap_gimple_op_r): Copy TREE_THIS_VOLATILE and
TREE_THIS_NOTRAP into the inner most MEM_REF.
Always copy TREE_THIS_VOLATILE.
* tree-sra.c (ptr_parm_has_direct_uses): Check that the lhs, rhs and
arguments are not volatile references.

2011-07-25  Andrew Pinski  

PR tree-opt/49671
* gcc.dg/tree-ssa/pr49671-1.c: New testcase.
* gcc.dg/tree-ssa/pr49671-2.c: New testcase.


Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/tree-ssa/pr49671-1.c
  - copied unchanged from r176782,
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr49671-1.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/tree-ssa/pr49671-2.c
  - copied unchanged from r176782,
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr49671-2.c
Modified:
branches/gcc-4_6-branch/   (props changed)
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/config/rs6000/rs6000.c   (props changed)
branches/gcc-4_6-branch/gcc/config/rs6000/rs6000.h   (props changed)
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/tree-inline.c
branches/gcc-4_6-branch/gcc/tree-sra.c

Propchange: branches/gcc-4_6-branch/
('svn:mergeinfo' modified)

Propchange: branches/gcc-4_6-branch/gcc/config/rs6000/rs6000.c
('svn:mergeinfo' modified)

Propchange: branches/gcc-4_6-branch/gcc/config/rs6000/rs6000.h
('svn:mergeinfo' modified)


[Bug middle-end/49671] [4.6/4.7 Regression] volatile goes missing after inlining

2011-07-25 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49671

--- Comment #5 from Andrew Pinski  2011-07-26 
05:28:50 UTC ---
Author: pinskia
Date: Tue Jul 26 05:28:45 2011
New Revision: 176782

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176782
Log:
2011-07-25  Andrew Pinski  

PR tree-opt/49671
* tree-inline.c (remap_gimple_op_r): Copy TREE_THIS_VOLATILE and
TREE_THIS_NOTRAP into the inner most MEM_REF.
Always copy TREE_THIS_VOLATILE.
* tree-sra.c (ptr_parm_has_direct_uses): Check that the lhs, rhs and
arguments are not volatile references.

2011-07-25  Andrew Pinski  

PR tree-opt/49671
* gcc.dg/tree-ssa/pr49671-1.c: New testcase.
* gcc.dg/tree-ssa/pr49671-2.c: New testcase.


Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr49671-1.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr49671-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-inline.c
trunk/gcc/tree-sra.c


[Bug middle-end/49671] [4.6/4.7 Regression] volatile goes missing after inlining

2011-07-08 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49671

--- Comment #4 from Richard Guenther  2011-07-08 
10:30:32 UTC ---
Doesn't the outermost component also need TREE_THIS_VOLATILE?  So I suppose
sink the

  TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);

from the else branch as well.


[Bug middle-end/49671] [4.6/4.7 Regression] volatile goes missing after inlining

2011-07-07 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49671

--- Comment #3 from Andrew Pinski  2011-07-07 
23:07:02 UTC ---
Created attachment 24708
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24708
Fix which I am going to test


[Bug middle-end/49671] [4.6/4.7 Regression] volatile goes missing after inlining

2011-07-07 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49671

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011.07.07 22:48:48
 AssignedTo|unassigned at gcc dot   |pinskia at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1

--- Comment #2 from Andrew Pinski  2011-07-07 
22:48:48 UTC ---
Note the following is also broken:
int t;
static inline int cvmx_atomic_get32(int *ptr)
{
return *(volatile int*)ptr;
}
void f(void)
{
  while (!cvmx_atomic_get32(&t))
;
}
--- CUT 
But that is caused by IPA-SRA.
I have a fix for both issues.


[Bug middle-end/49671] [4.6/4.7 Regression] volatile goes missing after inlining

2011-07-07 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49671

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||wrong-code
  Known to work||4.5.1
   Target Milestone|--- |4.6.2
Summary|volatile goes missing after |[4.6/4.7 Regression]
   |inlining|volatile goes missing after
   ||inlining
  Known to fail||4.6.1, 4.7.0

--- Comment #1 from Andrew Pinski  2011-07-07 
21:41:35 UTC ---
It was broken since at least "GCC: (GNU) 4.6.0 20110210 (experimental) [trunk
revision 170025]"