[Bug middle-end/42898] [4.3/4.4/4.5 Regression] volatile structures and compound literal initializers

2010-01-31 Thread rguenth at gcc dot gnu dot org


--- Comment #8 from rguenth at gcc dot gnu dot org  2010-01-31 17:01 ---
Subject: Bug 42898

Author: rguenth
Date: Sun Jan 31 17:01:38 2010
New Revision: 156404

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=156404
Log:
2010-01-31  Richard Guenther  rguent...@suse.de

PR middle-end/42898
* gimplify.c (gimplify_init_constructor): For volatile LHS
initialize a temporary.

* gcc.dg/torture/pr42898.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr42898.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42898



[Bug middle-end/42898] [4.3/4.4/4.5 Regression] volatile structures and compound literal initializers

2010-01-31 Thread rguenth at gcc dot gnu dot org


--- Comment #9 from rguenth at gcc dot gnu dot org  2010-01-31 17:04 ---
Subject: Bug 42898

Author: rguenth
Date: Sun Jan 31 17:04:29 2010
New Revision: 156405

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=156405
Log:
2010-01-31  Richard Guenther  rguent...@suse.de

PR middle-end/42898
* gimplify.c (gimplify_init_constructor): For volatile LHS
initialize a temporary.

* gcc.dg/torture/pr42898.c: New testcase.

Added:
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr42898.c
Modified:
branches/gcc-4_4-branch/gcc/ChangeLog
branches/gcc-4_4-branch/gcc/gimplify.c
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42898



[Bug middle-end/42898] [4.3/4.4/4.5 Regression] volatile structures and compound literal initializers

2010-01-31 Thread rguenth at gcc dot gnu dot org


--- Comment #10 from rguenth at gcc dot gnu dot org  2010-01-31 17:07 
---
Subject: Bug 42898

Author: rguenth
Date: Sun Jan 31 17:07:16 2010
New Revision: 156407

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=156407
Log:
2010-01-31  Richard Guenther  rguent...@suse.de

PR middle-end/42898
* gimplify.c (gimplify_init_constructor): For volatile LHS
initialize a temporary.

* gcc.dg/torture/pr42898.c: New testcase.

Added:
branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/torture/pr42898.c
Modified:
branches/gcc-4_3-branch/gcc/ChangeLog
branches/gcc-4_3-branch/gcc/gimplify.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42898



[Bug middle-end/42898] [4.3/4.4/4.5 Regression] volatile structures and compound literal initializers

2010-01-30 Thread rguenth at gcc dot gnu dot org


--- Comment #4 from rguenth at gcc dot gnu dot org  2010-01-30 18:08 ---
Martin - we recently regressed here due to SRA.  Even for f2 we now decompose
the assigment to *ptr, even though that will create extra volatile accesses.

I have a patch for the gimplifier bits (to be attached).


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jamborm at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42898



[Bug middle-end/42898] [4.3/4.4/4.5 Regression] volatile structures and compound literal initializers

2010-01-30 Thread rguenth at gcc dot gnu dot org


--- Comment #5 from rguenth at gcc dot gnu dot org  2010-01-30 18:17 ---
Created an attachment (id=19759)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19759action=view)
patch


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42898



[Bug middle-end/42898] [4.3/4.4/4.5 Regression] volatile structures and compound literal initializers

2010-01-30 Thread gandalf at winds dot org


--- Comment #6 from gandalf at winds dot org  2010-01-30 20:56 ---
The patch provided fixes this issue and brings the original GCC 4.2.2 behavior
back.

Thanks so much for your quick response!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42898



[Bug middle-end/42898] [4.3/4.4/4.5 Regression] volatile structures and compound literal initializers

2010-01-30 Thread rguenther at suse dot de


--- Comment #7 from rguenther at suse dot de  2010-01-30 21:25 ---
Subject: Re:  [4.3/4.4/4.5 Regression] volatile structures
 and compound literal initializers

On Sat, 30 Jan 2010, gandalf at winds dot org wrote:

 --- Comment #6 from gandalf at winds dot org  2010-01-30 20:56 ---
 The patch provided fixes this issue and brings the original GCC 4.2.2 behavior
 back.

Not yet for 4.5 though.

Richard.

 Thanks so much for your quick response!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42898



[Bug middle-end/42898] [4.3/4.4/4.5 Regression] volatile structures and compound literal initializers

2010-01-29 Thread rguenth at gcc dot gnu dot org


--- Comment #2 from rguenth at gcc dot gnu dot org  2010-01-29 22:41 ---
Yep:

f2 ()
{
  volatile struct hardware * ptr;
  struct hardware set;

  ptr = 287454020B;
  set = {};
  set.parm1 = 42;
  set.parm2 = -3;
  set.parm3 = 11850;
  set.parm4 = -1;
  *ptr = set;
}

f1 ()
{
  volatile struct hardware * ptr;

  ptr = 287454020B;
  *ptr = {};
  ptr-parm1 = 42;
  ptr-parm2 = -3;
  ptr-parm3 = 11850;
  ptr-parm4 = -1;
}

we need to gimplify f1 exactly the same as f2, using a temporary.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

  Component|c   |middle-end
Summary|[4.3/4.4/4.5 Regression]|[4.3/4.4/4.5 Regression]
   |volatile structures and |volatile structures and
   |compound literals   |compound literal
   ||initializers


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42898



[Bug middle-end/42898] [4.3/4.4/4.5 Regression] volatile structures and compound literal initializers

2010-01-29 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.4.4   |4.3.6


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42898



[Bug middle-end/42898] [4.3/4.4/4.5 Regression] volatile structures and compound literal initializers

2010-01-29 Thread rguenth at gcc dot gnu dot org


--- Comment #3 from rguenth at gcc dot gnu dot org  2010-01-29 22:42 ---
I will have a look.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2010-01-29 19:38:02 |2010-01-29 22:42:15
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42898