public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/20127] New: wrong code for volatile struct members?
@ 2005-02-22  2:14 schlie at comcast dot net
  2005-02-22  2:27 ` [Bug tree-optimization/20127] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: schlie at comcast dot net @ 2005-02-22  2:14 UTC (permalink / raw)
  To: gcc-bugs

The following code does not treat volatile struct members as volatile,
assuming such declarations are valid; if not would exect a warning:

typedef struct {
  volatile int a;
  volatile int b;
  } s;

int main (void){

  s x = {0, 1};
  s y = {2, 3};
  
  x = y;
  y = x;
  
  return x.a + y.a;

}

generates:

000000c6 <main>:
  volatile int a;
  volatile int b;
  } s;

int main (void){
  c6:	cf ef       	ldi	r28, 0xFF	; 255
  c8:	d0 e1       	ldi	r29, 0x10	; 16
  ca:	de bf       	out	0x3e, r29	; 62
  cc:	cd bf       	out	0x3d, r28	; 61

  s x = {0, 1};
  s y = {2, 3};
  
  x = y;
  y = x;
  
  return x.a + y.a;

}
  ce:	84 e0       	ldi	r24, 0x04	; 4
  d0:	90 e0       	ldi	r25, 0x00	; 0
  d2:	0c 94 6b 00 	jmp	0xd6 <_exit>

-- 
           Summary: wrong code for volatile struct members?
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schlie at comcast dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ppc-apple-darwin7.8
  GCC host triplet: ppc-apple-darwin7.8
GCC target triplet: avr-unknown-unknown


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/20127] wrong code for volatile struct members?
  2005-02-22  2:14 [Bug c/20127] New: wrong code for volatile struct members? schlie at comcast dot net
@ 2005-02-22  2:27 ` pinskia at gcc dot gnu dot org
  2005-02-25  2:33 ` [Bug tree-optimization/20127] [4.0 Regression] wrong code for volatile struct members rth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-22  2:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-21 22:19 -------
Hmm, SRA creates new variables and then goes and makes them renamed which seems wrong.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
          Component|c                           |tree-optimization
     Ever Confirmed|                            |1
  GCC build triplet|ppc-apple-darwin7.8         |
   GCC host triplet|ppc-apple-darwin7.8         |
 GCC target triplet|avr-unknown-unknown         |
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-02-21 22:19:24
               date|                            |
   Target Milestone|---                         |4.0.0


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/20127] [4.0 Regression] wrong code for volatile struct members
  2005-02-22  2:14 [Bug c/20127] New: wrong code for volatile struct members? schlie at comcast dot net
  2005-02-22  2:27 ` [Bug tree-optimization/20127] " pinskia at gcc dot gnu dot org
@ 2005-02-25  2:33 ` rth at gcc dot gnu dot org
  2005-02-25 14:56 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-02-25  2:33 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rth at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-02-21 22:19:24         |2005-02-24 21:59:32
               date|                            |


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/20127] [4.0 Regression] wrong code for volatile struct members
  2005-02-22  2:14 [Bug c/20127] New: wrong code for volatile struct members? schlie at comcast dot net
  2005-02-22  2:27 ` [Bug tree-optimization/20127] " pinskia at gcc dot gnu dot org
  2005-02-25  2:33 ` [Bug tree-optimization/20127] [4.0 Regression] wrong code for volatile struct members rth at gcc dot gnu dot org
@ 2005-02-25 14:56 ` cvs-commit at gcc dot gnu dot org
  2005-02-25 15:02 ` rth at gcc dot gnu dot org
  2005-02-25 15:03 ` schlie at comcast dot net
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-02-25 14:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-02-25 01:56 -------
Subject: Bug 20127

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2005-02-25 01:56:18

Modified files:
	gcc            : ChangeLog tree-sra.c 

Log message:
	PR tree-opt/20127
	* tree-sra.c (instantiate_element): Copy TREE_THIS_VOLATILE from
	the type.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7589&r2=2.7590
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-sra.c.diff?cvsroot=gcc&r1=2.52&r2=2.53



-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/20127] [4.0 Regression] wrong code for volatile struct members
  2005-02-22  2:14 [Bug c/20127] New: wrong code for volatile struct members? schlie at comcast dot net
                   ` (2 preceding siblings ...)
  2005-02-25 14:56 ` cvs-commit at gcc dot gnu dot org
@ 2005-02-25 15:02 ` rth at gcc dot gnu dot org
  2005-02-25 15:03 ` schlie at comcast dot net
  4 siblings, 0 replies; 6+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-02-25 15:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2005-02-25 01:57 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/20127] [4.0 Regression] wrong code for volatile struct members
  2005-02-22  2:14 [Bug c/20127] New: wrong code for volatile struct members? schlie at comcast dot net
                   ` (3 preceding siblings ...)
  2005-02-25 15:02 ` rth at gcc dot gnu dot org
@ 2005-02-25 15:03 ` schlie at comcast dot net
  4 siblings, 0 replies; 6+ messages in thread
From: schlie at comcast dot net @ 2005-02-25 15:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schlie at comcast dot net  2005-02-25 02:06 -------
Subject: Re:  [4.0 Regression] wrong code for
 volatile struct members

Additional Comments From rth at gcc dot gnu dot org  2005-02-25 01:57
> -------
> Fixed.
> 
> -- 

Thank you.




-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-02-25  2:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-22  2:14 [Bug c/20127] New: wrong code for volatile struct members? schlie at comcast dot net
2005-02-22  2:27 ` [Bug tree-optimization/20127] " pinskia at gcc dot gnu dot org
2005-02-25  2:33 ` [Bug tree-optimization/20127] [4.0 Regression] wrong code for volatile struct members rth at gcc dot gnu dot org
2005-02-25 14:56 ` cvs-commit at gcc dot gnu dot org
2005-02-25 15:02 ` rth at gcc dot gnu dot org
2005-02-25 15:03 ` schlie at comcast dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).