public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/18617] New: missed volatile variable optimizations
@ 2004-11-22 23:48 schlie at comcast dot net
  2004-11-22 23:56 ` [Bug target/18617] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: schlie at comcast dot net @ 2004-11-22 23:48 UTC (permalink / raw)
  To: gcc-bugs

The below program and resulting code demonstrates:

- volatile variables are needlessly initilized through a temporary, rather than being initialized directly.
- volatile variable function arguments aren't passed direclty, but needlessly use an 
intermediate temporary variable.
- normal variable function arguments with a volatile variable target seems to inhibits the recognition of 
word-wide move's for normal variable argument passing, which are recognized otherwise

main.c

int main (void) {

            long lx, ly = 3;
   volatile long lv = 5;
   
            long long llx, lly = 6;
   volatile long long llv = 7;
	
   lv = lx * ly;
   lv = lv * lv;
   
   llv = llx * lly;
   llv = llv * llv;
   
   return lx + ly + llx + lly;
}

main.lst

   1               		.file	"main.c"
   2               		.arch atmega64
   3               	__SREG__ = 0x3f
   4               	__SP_H__ = 0x3e
   5               	__SP_L__ = 0x3d
   6               	__tmp_reg__ = 0
   7               	__zero_reg__ = 1
   8               		.global __do_copy_data
   9               		.global __do_clear_bss
  12               		.text
  13               	.Ltext0:
  37               	.global	main
  39               	main:
   1:main.c        **** int main (void) {
  41               	.LM1:
  42               	/* prologue: frame size=32 */
  43 0000 C0E0      		ldi r28,lo8(__stack - 32)
  44 0002 D0E0      		ldi r29,hi8(__stack - 32)
  45 0004 DEBF      		out __SP_H__,r29
  46 0006 CDBF      		out __SP_L__,r28
  47               	/* prologue end (size=4) */
  48 0008 198A      		std Y+17,__zero_reg__
  49 000a 1A8A      		std Y+18,__zero_reg__
   2:main.c        **** 
   3:main.c        ****             long lx, ly = 3;
   4:main.c        ****    volatile long lv = 5;
  51               	.LM2:
  52 000c 85E0      		ldi r24,lo8(5)
  53 000e 90E0      		ldi r25,hi8(5)
  54 0010 A0E0      		ldi r26,hlo8(5)
  55 0012 B0E0      		ldi r27,hhi8(5)
  56 0014 8983      		std Y+1,r24
  57 0016 9A83      		std Y+2,r25
  58 0018 AB83      		std Y+3,r26
  59 001a BC83      		std Y+4,r27
   5:main.c        ****    
   6:main.c        ****             long long llx, lly = 6;
  61               	.LM3:
  62 001c 26E0      		ldi r18,lo8(6)
  63 001e 298F      		std Y+25,r18
  64 0020 1A8E      		std Y+26,__zero_reg__
   7:main.c        ****    volatile long long llv = 7;
  66               	.LM4:
  67 0022 87E0      		ldi r24,lo8(7)
  68 0024 8D83      		std Y+5,r24
  69 0026 1E82      		std Y+6,__zero_reg__
  70 0028 1F82      		std Y+7,__zero_reg__
  71 002a 1886      		std Y+8,__zero_reg__
  72 002c 1986      		std Y+9,__zero_reg__
  73 002e 1A86      		std Y+10,__zero_reg__
  74 0030 1B86      		std Y+11,__zero_reg__
  75 0032 1C86      		std Y+12,__zero_reg__
   8:main.c        **** 	
   9:main.c        ****    lv = lx * ly;
  77               	.LM5:
  78 0034 6D85      		ldd r22,Y+13
  79 0036 7E85      		ldd r23,Y+14
  80 0038 8F85      		ldd r24,Y+15
  81 003a 9889      		ldd r25,Y+16
  82 003c 23E0      		ldi r18,lo8(3)
  83 003e 30E0      		ldi r19,hi8(3)
  84 0040 40E0      		ldi r20,hlo8(3)
  85 0042 50E0      		ldi r21,hhi8(3)
  86 0044 0E94 0000 		call __mulsi3
  87 0048 DC01      		movw r26,r24
  88 004a CB01      		movw r24,r22
  89 004c 8983      		std Y+1,r24
  90 004e 9A83      		std Y+2,r25
  91 0050 AB83      		std Y+3,r26
  92 0052 BC83      		std Y+4,r27
  10:main.c        ****    lv = lv * lv;
  94               	.LM6:
  95 0054 8981      		ldd r24,Y+1
  96 0056 9A81      		ldd r25,Y+2
  97 0058 AB81      		ldd r26,Y+3
  98 005a BC81      		ldd r27,Y+4
  99 005c 2981      		ldd r18,Y+1
 100 005e 3A81      		ldd r19,Y+2
 101 0060 4B81      		ldd r20,Y+3
 102 0062 5C81      		ldd r21,Y+4
 103 0064 BC01      		movw r22,r24
 104 0066 CD01      		movw r24,r26
 105 0068 0E94 0000 		call __mulsi3
 106 006c DC01      		movw r26,r24
 107 006e CB01      		movw r24,r22
 108 0070 8983      		std Y+1,r24
 109 0072 9A83      		std Y+2,r25
 110 0074 AB83      		std Y+3,r26
 111 0076 BC83      		std Y+4,r27
  11:main.c        ****    
  12:main.c        ****    llv = llx * lly;
 113               	.LM7:
 114 0078 A98C      		ldd r10,Y+25
 115 007a BA8C      		ldd r11,Y+26
 116 007c CB2C      		mov r12,r11
 117 007e DB2C      		mov r13,r11
 118 0080 EB2C      		mov r14,r11
 119 0082 FB2C      		mov r15,r11
 120 0084 0B2D      		mov r16,r11
 121 0086 1B2D      		mov r17,r11
 122 0088 2B2D      		mov r18,r11
 123 008a 3B2D      		mov r19,r11
 124 008c 4B2D      		mov r20,r11
 125 008e 5B2D      		mov r21,r11
 126 0090 6B2D      		mov r22,r11
 127 0092 7B2D      		mov r23,r11
 128 0094 8B2D      		mov r24,r11
 129 0096 9B2D      		mov r25,r11
 130 0098 0E94 0000 		call __muldi3
 131 009c 2D83      		std Y+5,r18
 132 009e 3E83      		std Y+6,r19
 133 00a0 4F83      		std Y+7,r20
 134 00a2 5887      		std Y+8,r21
 135 00a4 6987      		std Y+9,r22
 136 00a6 7A87      		std Y+10,r23
 137 00a8 8B87      		std Y+11,r24
 138 00aa 9C87      		std Y+12,r25
  13:main.c        ****    llv = llv * llv;
 140               	.LM8:
 141 00ac 2D80      		ldd r2,Y+5
 142 00ae 3E80      		ldd r3,Y+6
 143 00b0 4F80      		ldd r4,Y+7
 144 00b2 5884      		ldd r5,Y+8
 145 00b4 6984      		ldd r6,Y+9
 146 00b6 7A84      		ldd r7,Y+10
 147 00b8 8B84      		ldd r8,Y+11
 148 00ba 9C84      		ldd r9,Y+12
 149 00bc 2D81      		ldd r18,Y+5
 150 00be 3E81      		ldd r19,Y+6
 151 00c0 4F81      		ldd r20,Y+7
 152 00c2 5885      		ldd r21,Y+8
 153 00c4 6985      		ldd r22,Y+9
 154 00c6 7A85      		ldd r23,Y+10
 155 00c8 8B85      		ldd r24,Y+11
 156 00ca 9C85      		ldd r25,Y+12
 157 00cc A22E      		mov r10,r18
 158 00ce B32E      		mov r11,r19
 159 00d0 C42E      		mov r12,r20
 160 00d2 D52E      		mov r13,r21
 161 00d4 E62E      		mov r14,r22
 162 00d6 F72E      		mov r15,r23
 163 00d8 082F      		mov r16,r24
 164 00da 192F      		mov r17,r25
 165 00dc 222D      		mov r18,r2
 166 00de 332D      		mov r19,r3
 167 00e0 442D      		mov r20,r4
 168 00e2 552D      		mov r21,r5
 169 00e4 662D      		mov r22,r6
 170 00e6 772D      		mov r23,r7
 171 00e8 882D      		mov r24,r8
 172 00ea 992D      		mov r25,r9
 173 00ec 0E94 0000 		call __muldi3
 174 00f0 2D83      		std Y+5,r18
 175 00f2 3E83      		std Y+6,r19
 176 00f4 4F83      		std Y+7,r20
 177 00f6 5887      		std Y+8,r21
 178 00f8 6987      		std Y+9,r22
 179 00fa 7A87      		std Y+10,r23
 180 00fc 8B87      		std Y+11,r24
 181 00fe 9C87      		std Y+12,r25
  14:main.c        ****    
  15:main.c        ****    return lx + ly + llx + lly;
 183               	.LM9:
 184 0100 8D85      		ldd r24,Y+13
 185 0102 9E85      		ldd r25,Y+14
 186 0104 0396      		adiw r24,3
 187 0106 2989      		ldd r18,Y+17
 188 0108 3A89      		ldd r19,Y+18
 189 010a 820F      		add r24,r18
 190 010c 931F      		adc r25,r19
  16:main.c        **** }
 192               	.LM10:
 193 010e 298D      		ldd r18,Y+25
 194 0110 3A8D      		ldd r19,Y+26
 195 0112 820F      		add r24,r18
 196 0114 931F      		adc r25,r19
 197               	/* epilogue: frame size=32 */
 198 0116 0C94 0000 		jmp exit
 199               	/* epilogue end (size=2) */
 200               	/* function main size 141 (135) */
 209               	.Lscope0:
 211               		.text
 213               	Letext:
 214               	/* File "main.c": code  141 = 0x008d ( 135), prologues   4, epilogues   2 */
DEFINED SYMBOLS
                            *ABS*:00000000 main.c
                            *ABS*:0000003f __SREG__
                            *ABS*:0000003e __SP_H__
                            *ABS*:0000003d __SP_L__
                            *ABS*:00000000 __tmp_reg__
                            *ABS*:00000001 __zero_reg__
/var/tmp//ccNIsAYP.s:39     .text:00000000 main
/var/tmp//ccNIsAYP.s:213    .text:0000011a Letext

UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
__stack
__mulsi3
__muldi3
exit

-- 
           Summary: missed volatile variable optimizations
           Product: gcc
           Version: 3.4.3
            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 host triplet: ppc
GCC target triplet: avr


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


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

* [Bug target/18617] missed volatile variable optimizations
  2004-11-22 23:48 [Bug c/18617] New: missed volatile variable optimizations schlie at comcast dot net
@ 2004-11-22 23:56 ` pinskia at gcc dot gnu dot org
  2004-11-23 13:49 ` schlie at comcast dot net
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-22 23:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-22 23:56 -------
This is target problem.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target
           Keywords|                            |missed-optimization


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


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

* [Bug target/18617] missed volatile variable optimizations
  2004-11-22 23:48 [Bug c/18617] New: missed volatile variable optimizations schlie at comcast dot net
  2004-11-22 23:56 ` [Bug target/18617] " pinskia at gcc dot gnu dot org
@ 2004-11-23 13:49 ` schlie at comcast dot net
  2005-01-20  2:36 ` pinskia at gcc dot gnu dot org
  2005-06-19 14:52 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 7+ messages in thread
From: schlie at comcast dot net @ 2004-11-23 13:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schlie at comcast dot net  2004-11-23 13:49 -------
Subject: Re:  missed volatile variable optimizations

Reviewing the rtl dump of the code, it does appear that SI mode volatile
and nonvolatile variables are being initialized similarly (through an
intermediate), but DI mode variables aren't (which may be a libgcc2
anomaly); where SI mode variables are first being assigned to an
intermediate temporary, then being set to that intermediate value, as
opposed to being set directly using a const_int source value in the
initialization expression: i.e.

(insn 12 11 13 (set (mem/v/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 8 [0x8])) [0 lv+0 S4 A32])
        (const_int 5 [0x5])) -1 (nil)
    (nil))

vs. 

(insn 11 10 12 (set (reg:SI 43)
        (const_int 5 [0x5])) -1 (nil)
    (nil))

(insn 12 11 13 (set (mem/v/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 8 [0x8])) [0 lv+0 S4 A32])
        (reg:SI 43)) -1 (nil)
    (nil))

where the former would seem more ideal (if the value wasn't subsequently
required, which it isn't, and not rely on back-end optimization)?

But DI mode non-volatile variables are split between being initialized by
being decomposed to QI mode assignments, partially through the use of an
intermediate, and a known zero register value, which actually complicates
things a bit as the rtl representation has hidden the notion of a DI mode
variable, inhibiting potential subsequent optimizations; while volatile DI
mode variables are being initialized through the use of an intermediate as
SI mode variable initialization is.

If nothing else, this non-uniformity of initialization behavior would seem
to complicate the then necessary back-end target specific optimization then
required to optimize it's implementation mapping?

(I suspect that this non-uniformity may have to do with how DI mode
variables operations are defined in libgcc2 by default vs SI mode variable
operations?)

-----

;; Function main

(note 1 0 2 ("main.c") 1)

(note 2 1 3 NOTE_INSN_DELETED)

(note 3 2 4 NOTE_INSN_FUNCTION_BEG)

(note 4 3 5 NOTE_INSN_DELETED)

(note 5 4 6 0x40884190 NOTE_INSN_BLOCK_BEG)

(note 6 5 7 NOTE_INSN_DELETED)

(note 7 6 8 ("main.c") 3)

(insn 8 7 9 (set (reg:SI 42)
        (const_int 3 [0x3])) -1 (nil)
    (nil))

(insn 9 8 10 (set (mem/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 4 [0x4])) [0 ly+0 S4 A32])
        (reg:SI 42)) -1 (nil)
    (nil))

(note 10 9 11 ("main.c") 4)

(insn 11 10 12 (set (reg:SI 43)
        (const_int 5 [0x5])) -1 (nil)
    (nil))

(insn 12 11 13 (set (mem/v/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 8 [0x8])) [0 lv+0 S4 A32])
        (reg:SI 43)) -1 (nil)
    (nil))

(note 13 12 14 ("main.c") 6)

(insn 14 13 15 (set (reg:QI 44)
        (const_int 6 [0x6])) -1 (nil)
    (nil))

(insn 15 14 16 (set (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 20 [0x14])) [0 lly+0 S1 A64])
        (reg:QI 44)) -1 (nil)
    (nil))

(insn 16 15 17 (set (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 21 [0x15])) [0 lly+1 S1 A8])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 17 16 18 (set (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 22 [0x16])) [0 lly+2 S1 A16])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 18 17 19 (set (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 23 [0x17])) [0 lly+3 S1 A8])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 19 18 20 (set (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 24 [0x18])) [0 lly+4 S1 A32])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 20 19 21 (set (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 25 [0x19])) [0 lly+5 S1 A8])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 21 20 22 (set (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 26 [0x1a])) [0 lly+6 S1 A16])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 22 21 23 (set (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 27 [0x1b])) [0 lly+7 S1 A8])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(note 23 22 24 ("main.c") 7)

(insn 24 23 25 (set (reg:QI 45)
        (const_int 7 [0x7])) -1 (nil)
    (nil))

(insn 25 24 26 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 28 [0x1c])) [0 llv+0 S1 A64])
        (reg:QI 45)) -1 (nil)
    (nil))

(insn 26 25 27 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 29 [0x1d])) [0 llv+1 S1 A8])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 27 26 28 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 30 [0x1e])) [0 llv+2 S1 A16])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 28 27 29 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 31 [0x1f])) [0 llv+3 S1 A8])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 29 28 30 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 32 [0x20])) [0 llv+4 S1 A32])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 30 29 31 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 33 [0x21])) [0 llv+5 S1 A8])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 31 30 32 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 34 [0x22])) [0 llv+6 S1 A16])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 32 31 33 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 35 [0x23])) [0 llv+7 S1 A8])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(note 33 32 34 ("main.c") 9)

(insn 34 33 35 (set (reg:SI 18 r18)
        (mem/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 4 [0x4])) [0 ly+0 S4 A32])) -1 (nil)
    (insn_list:REG_LIBCALL 37 (nil)))

(insn 35 34 36 (set (reg:SI 22 r22)
        (mem/f:SI (reg/f:HI 37 virtual-stack-vars) [0 lx+0 S4 A32])) -1
(nil)
    (nil))

(call_insn/u 36 35 37 (set (reg:SI 22 r22)
        (call (mem:HI (symbol_ref:HI ("__mulsi3") [flags 0x41]) [0 S2 A8])
            (const_int 0 [0x0]))) -1 (nil)
    (expr_list:REG_EH_REGION (const_int -1 [0xffffffff])
        (nil))
    (expr_list (use (reg:SI 18 r18))
        (expr_list (use (reg:SI 22 r22))
            (nil))))

(insn 37 36 38 (set (reg:SI 46)
        (reg:SI 22 r22)) -1 (nil)
    (insn_list:REG_RETVAL 34 (expr_list:REG_EQUAL (mult:SI (mem/f:SI
(reg/f:HI 37 virtual-stack-vars) [0 lx+0 S4 A32])
                (mem/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                        (const_int 4 [0x4])) [0 ly+0 S4 A32]))
            (nil))))

(insn 38 37 39 (set (mem/v/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 8 [0x8])) [0 lv+0 S4 A32])
        (reg:SI 46)) -1 (nil)
    (nil))

(note 39 38 40 ("main.c") 10)

(insn 40 39 41 (set (reg:SI 18 r18)
        (mem/v/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 8 [0x8])) [0 lv+0 S4 A32])) -1 (nil)
    (insn_list:REG_LIBCALL 43 (nil)))

(insn 41 40 42 (set (reg:SI 22 r22)
        (mem/v/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 8 [0x8])) [0 lv+0 S4 A32])) -1 (nil)
    (nil))

(call_insn/u 42 41 43 (set (reg:SI 22 r22)
        (call (mem:HI (symbol_ref:HI ("__mulsi3") [flags 0x41]) [0 S2 A8])
            (const_int 0 [0x0]))) -1 (nil)
    (expr_list:REG_EH_REGION (const_int -1 [0xffffffff])
        (nil))
    (expr_list (use (reg:SI 18 r18))
        (expr_list (use (reg:SI 22 r22))
            (nil))))

(insn 43 42 44 (set (reg:SI 47)
        (reg:SI 22 r22)) -1 (nil)
    (insn_list:REG_RETVAL 40 (expr_list:REG_EQUAL (mult:SI (mem/v/f:SI
(plus:HI (reg/f:HI 37 virtual-stack-vars)
                        (const_int 8 [0x8])) [0 lv+0 S4 A32])
                (mem/v/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                        (const_int 8 [0x8])) [0 lv+0 S4 A32]))
            (nil))))

(insn 44 43 45 (set (mem/v/f:SI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 8 [0x8])) [0 lv+0 S4 A32])
        (reg:SI 47)) -1 (nil)
    (nil))

(note 45 44 46 ("main.c") 12)

(insn 46 45 47 (set (reg:QI 10 r10)
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 20 [0x14])) [0 lly+0 S1 A64])) -1 (nil)
    (insn_list:REG_LIBCALL 70 (nil)))

(insn 47 46 48 (set (reg:QI 11 r11 [+1 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 21 [0x15])) [0 lly+1 S1 A8])) -1 (nil)
    (nil))

(insn 48 47 49 (set (reg:QI 12 r12 [+2 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 22 [0x16])) [0 lly+2 S1 A16])) -1 (nil)
    (nil))

(insn 49 48 50 (set (reg:QI 13 r13 [+3 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 23 [0x17])) [0 lly+3 S1 A8])) -1 (nil)
    (nil))

(insn 50 49 51 (set (reg:QI 14 r14 [+4 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 24 [0x18])) [0 lly+4 S1 A32])) -1 (nil)
    (nil))

(insn 51 50 52 (set (reg:QI 15 r15 [+5 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 25 [0x19])) [0 lly+5 S1 A8])) -1 (nil)
    (nil))

(insn 52 51 53 (set (reg:QI 16 r16 [+6 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 26 [0x1a])) [0 lly+6 S1 A16])) -1 (nil)
    (nil))

(insn 53 52 54 (set (reg:QI 17 r17 [+7 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 27 [0x1b])) [0 lly+7 S1 A8])) -1 (nil)
    (nil))

(insn 54 53 55 (set (reg:QI 18 r18)
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 12 [0xc])) [0 llx+0 S1 A64])) -1 (nil)
    (nil))

(insn 55 54 56 (set (reg:QI 19 r19 [+1 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 13 [0xd])) [0 llx+1 S1 A8])) -1 (nil)
    (nil))

(insn 56 55 57 (set (reg:QI 20 r20 [+2 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 14 [0xe])) [0 llx+2 S1 A16])) -1 (nil)
    (nil))

(insn 57 56 58 (set (reg:QI 21 r21 [+3 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 15 [0xf])) [0 llx+3 S1 A8])) -1 (nil)
    (nil))

(insn 58 57 59 (set (reg:QI 22 r22 [+4 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 16 [0x10])) [0 llx+4 S1 A32])) -1 (nil)
    (nil))

(insn 59 58 60 (set (reg:QI 23 r23 [+5 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 17 [0x11])) [0 llx+5 S1 A8])) -1 (nil)
    (nil))

(insn 60 59 61 (set (reg:QI 24 r24 [+6 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 18 [0x12])) [0 llx+6 S1 A16])) -1 (nil)
    (nil))

(insn 61 60 62 (set (reg:QI 25 r25 [+7 ])
        (mem/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 19 [0x13])) [0 llx+7 S1 A8])) -1 (nil)
    (nil))

(call_insn/u 62 61 71 (set (reg:DI 18 r18)
        (call (mem:HI (symbol_ref:HI ("__muldi3") [flags 0x41]) [0 S2 A8])
            (const_int 0 [0x0]))) -1 (nil)
    (expr_list:REG_EH_REGION (const_int -1 [0xffffffff])
        (nil))
    (expr_list (use (reg:DI 10 r10))
        (expr_list (use (reg:DI 18 r18))
            (nil))))

(insn 71 62 63 (clobber (reg:DI 48)) -1 (nil)
    (nil))

(insn 63 71 64 (set (subreg:QI (reg:DI 48) 0)
        (reg:QI 18 r18)) -1 (nil)
    (nil))

(insn 64 63 65 (set (subreg:QI (reg:DI 48) 1)
        (reg:QI 19 r19 [+1 ])) -1 (nil)
    (nil))

(insn 65 64 66 (set (subreg:QI (reg:DI 48) 2)
        (reg:QI 20 r20 [+2 ])) -1 (nil)
    (nil))

(insn 66 65 67 (set (subreg:QI (reg:DI 48) 3)
        (reg:QI 21 r21 [+3 ])) -1 (nil)
    (nil))

(insn 67 66 68 (set (subreg:QI (reg:DI 48) 4)
        (reg:QI 22 r22 [+4 ])) -1 (nil)
    (nil))

(insn 68 67 69 (set (subreg:QI (reg:DI 48) 5)
        (reg:QI 23 r23 [+5 ])) -1 (nil)
    (nil))

(insn 69 68 70 (set (subreg:QI (reg:DI 48) 6)
        (reg:QI 24 r24 [+6 ])) -1 (nil)
    (nil))

(insn 70 69 72 (set (subreg:QI (reg:DI 48) 7)
        (reg:QI 25 r25 [+7 ])) -1 (nil)
    (insn_list:REG_RETVAL 46 (nil)))

(insn 72 70 73 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 28 [0x1c])) [0 llv+0 S1 A64])
        (subreg:QI (reg:DI 48) 0)) -1 (nil)
    (nil))

(insn 73 72 74 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 29 [0x1d])) [0 llv+1 S1 A8])
        (subreg:QI (reg:DI 48) 1)) -1 (nil)
    (nil))

(insn 74 73 75 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 30 [0x1e])) [0 llv+2 S1 A16])
        (subreg:QI (reg:DI 48) 2)) -1 (nil)
    (nil))

(insn 75 74 76 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 31 [0x1f])) [0 llv+3 S1 A8])
        (subreg:QI (reg:DI 48) 3)) -1 (nil)
    (nil))

(insn 76 75 77 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 32 [0x20])) [0 llv+4 S1 A32])
        (subreg:QI (reg:DI 48) 4)) -1 (nil)
    (nil))

(insn 77 76 78 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 33 [0x21])) [0 llv+5 S1 A8])
        (subreg:QI (reg:DI 48) 5)) -1 (nil)
    (nil))

(insn 78 77 79 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 34 [0x22])) [0 llv+6 S1 A16])
        (subreg:QI (reg:DI 48) 6)) -1 (nil)
    (nil))

(insn 79 78 80 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 35 [0x23])) [0 llv+7 S1 A8])
        (subreg:QI (reg:DI 48) 7)) -1 (nil)
    (nil))

(note 80 79 81 ("main.c") 13)

(insn 81 80 82 (set (reg:QI 10 r10)
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 28 [0x1c])) [0 llv+0 S1 A64])) -1 (nil)
    (insn_list:REG_LIBCALL 105 (nil)))

(insn 82 81 83 (set (reg:QI 11 r11 [+1 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 29 [0x1d])) [0 llv+1 S1 A8])) -1 (nil)
    (nil))

(insn 83 82 84 (set (reg:QI 12 r12 [+2 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 30 [0x1e])) [0 llv+2 S1 A16])) -1 (nil)
    (nil))

(insn 84 83 85 (set (reg:QI 13 r13 [+3 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 31 [0x1f])) [0 llv+3 S1 A8])) -1 (nil)
    (nil))

(insn 85 84 86 (set (reg:QI 14 r14 [+4 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 32 [0x20])) [0 llv+4 S1 A32])) -1 (nil)
    (nil))

(insn 86 85 87 (set (reg:QI 15 r15 [+5 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 33 [0x21])) [0 llv+5 S1 A8])) -1 (nil)
    (nil))

(insn 87 86 88 (set (reg:QI 16 r16 [+6 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 34 [0x22])) [0 llv+6 S1 A16])) -1 (nil)
    (nil))

(insn 88 87 89 (set (reg:QI 17 r17 [+7 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 35 [0x23])) [0 llv+7 S1 A8])) -1 (nil)
    (nil))

(insn 89 88 90 (set (reg:QI 18 r18)
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 28 [0x1c])) [0 llv+0 S1 A64])) -1 (nil)
    (nil))

(insn 90 89 91 (set (reg:QI 19 r19 [+1 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 29 [0x1d])) [0 llv+1 S1 A8])) -1 (nil)
    (nil))

(insn 91 90 92 (set (reg:QI 20 r20 [+2 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 30 [0x1e])) [0 llv+2 S1 A16])) -1 (nil)
    (nil))

(insn 92 91 93 (set (reg:QI 21 r21 [+3 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 31 [0x1f])) [0 llv+3 S1 A8])) -1 (nil)
    (nil))

(insn 93 92 94 (set (reg:QI 22 r22 [+4 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 32 [0x20])) [0 llv+4 S1 A32])) -1 (nil)
    (nil))

(insn 94 93 95 (set (reg:QI 23 r23 [+5 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 33 [0x21])) [0 llv+5 S1 A8])) -1 (nil)
    (nil))

(insn 95 94 96 (set (reg:QI 24 r24 [+6 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 34 [0x22])) [0 llv+6 S1 A16])) -1 (nil)
    (nil))

(insn 96 95 97 (set (reg:QI 25 r25 [+7 ])
        (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 35 [0x23])) [0 llv+7 S1 A8])) -1 (nil)
    (nil))

(call_insn/u 97 96 106 (set (reg:DI 18 r18)
        (call (mem:HI (symbol_ref:HI ("__muldi3") [flags 0x41]) [0 S2 A8])
            (const_int 0 [0x0]))) -1 (nil)
    (expr_list:REG_EH_REGION (const_int -1 [0xffffffff])
        (nil))
    (expr_list (use (reg:DI 10 r10))
        (expr_list (use (reg:DI 18 r18))
            (nil))))

(insn 106 97 98 (clobber (reg:DI 49)) -1 (nil)
    (nil))

(insn 98 106 99 (set (subreg:QI (reg:DI 49) 0)
        (reg:QI 18 r18)) -1 (nil)
    (nil))

(insn 99 98 100 (set (subreg:QI (reg:DI 49) 1)
        (reg:QI 19 r19 [+1 ])) -1 (nil)
    (nil))

(insn 100 99 101 (set (subreg:QI (reg:DI 49) 2)
        (reg:QI 20 r20 [+2 ])) -1 (nil)
    (nil))

(insn 101 100 102 (set (subreg:QI (reg:DI 49) 3)
        (reg:QI 21 r21 [+3 ])) -1 (nil)
    (nil))

(insn 102 101 103 (set (subreg:QI (reg:DI 49) 4)
        (reg:QI 22 r22 [+4 ])) -1 (nil)
    (nil))

(insn 103 102 104 (set (subreg:QI (reg:DI 49) 5)
        (reg:QI 23 r23 [+5 ])) -1 (nil)
    (nil))

(insn 104 103 105 (set (subreg:QI (reg:DI 49) 6)
        (reg:QI 24 r24 [+6 ])) -1 (nil)
    (nil))

(insn 105 104 107 (set (subreg:QI (reg:DI 49) 7)
        (reg:QI 25 r25 [+7 ])) -1 (nil)
    (insn_list:REG_RETVAL 81 (nil)))

(insn 107 105 108 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 28 [0x1c])) [0 llv+0 S1 A64])
        (subreg:QI (reg:DI 49) 0)) -1 (nil)
    (nil))

(insn 108 107 109 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 29 [0x1d])) [0 llv+1 S1 A8])
        (subreg:QI (reg:DI 49) 1)) -1 (nil)
    (nil))

(insn 109 108 110 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 30 [0x1e])) [0 llv+2 S1 A16])
        (subreg:QI (reg:DI 49) 2)) -1 (nil)
    (nil))

(insn 110 109 111 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 31 [0x1f])) [0 llv+3 S1 A8])
        (subreg:QI (reg:DI 49) 3)) -1 (nil)
    (nil))

(insn 111 110 112 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 32 [0x20])) [0 llv+4 S1 A32])
        (subreg:QI (reg:DI 49) 4)) -1 (nil)
    (nil))

(insn 112 111 113 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 33 [0x21])) [0 llv+5 S1 A8])
        (subreg:QI (reg:DI 49) 5)) -1 (nil)
    (nil))

(insn 113 112 114 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 34 [0x22])) [0 llv+6 S1 A16])
        (subreg:QI (reg:DI 49) 6)) -1 (nil)
    (nil))

(insn 114 113 115 (set (mem/v/f:QI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 35 [0x23])) [0 llv+7 S1 A8])
        (subreg:QI (reg:DI 49) 7)) -1 (nil)
    (nil))

(note 115 114 116 ("main.c") 15)

(note 116 115 117 NOTE_INSN_DELETED)

(note 117 116 118 NOTE_INSN_DELETED)

(insn 118 117 119 (set (reg:HI 50)
        (mem/f:HI (reg/f:HI 37 virtual-stack-vars) [0 lx+0 S2 A32])) -1
(nil)
    (nil))

(insn 119 118 120 (set (reg:HI 51)
        (mem/f:HI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 4 [0x4])) [0 ly+0 S2 A32])) -1 (nil)
    (nil))

(insn 120 119 121 (set (reg:HI 50)
        (plus:HI (reg:HI 50)
            (reg:HI 51))) -1 (nil)
    (nil))

(insn 121 120 122 (set (reg:HI 52)
        (mem/f:HI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 12 [0xc])) [0 llx+0 S2 A64])) -1 (nil)
    (nil))

(insn 122 121 123 (set (reg:HI 50)
        (plus:HI (reg:HI 50)
            (reg:HI 52))) -1 (nil)
    (nil))

(insn 123 122 124 (set (reg:HI 53)
        (mem/f:HI (plus:HI (reg/f:HI 37 virtual-stack-vars)
                (const_int 20 [0x14])) [0 lly+0 S2 A64])) -1 (nil)
    (nil))

(insn 124 123 125 (set (reg:HI 50)
        (plus:HI (reg:HI 50)
            (reg:HI 53))) -1 (nil)
    (nil))

(insn 125 124 126 (set (reg:HI 41 [ <result> ])
        (reg:HI 50)) -1 (nil)
    (nil))

(jump_insn 126 125 127 (set (pc)
        (label_ref 131)) -1 (nil)
    (nil))

(barrier 127 126 128)

(note 128 127 129 0x40884190 NOTE_INSN_BLOCK_END)

(note 129 128 130 NOTE_INSN_FUNCTION_END)

(note 130 129 133 ("main.c") 16)

(insn 133 130 134 (clobber (reg/i:HI 24 r24)) -1 (nil)
    (nil))

(insn 134 133 131 (clobber (reg:HI 41 [ <result> ])) -1 (nil)
    (nil))

(code_label 131 134 132 1 "" [0 uses])

(insn 132 131 135 (set (reg/i:HI 24 r24)
        (reg:HI 41 [ <result> ])) -1 (nil)
    (nil))

(insn 135 132 0 (use (reg/i:HI 24 r24)) -1 (nil)
    (nil))




-- 


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


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

* [Bug target/18617] missed volatile variable optimizations
  2004-11-22 23:48 [Bug c/18617] New: missed volatile variable optimizations schlie at comcast dot net
  2004-11-22 23:56 ` [Bug target/18617] " pinskia at gcc dot gnu dot org
  2004-11-23 13:49 ` schlie at comcast dot net
@ 2005-01-20  2:36 ` pinskia at gcc dot gnu dot org
  2005-06-19 14:52 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-20  2:36 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ra


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


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

* [Bug target/18617] missed volatile variable optimizations
  2004-11-22 23:48 [Bug c/18617] New: missed volatile variable optimizations schlie at comcast dot net
                   ` (2 preceding siblings ...)
  2005-01-20  2:36 ` pinskia at gcc dot gnu dot org
@ 2005-06-19 14:52 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-19 14:52 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   GCC host triplet|ppc                         |


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


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

* [Bug target/18617] missed volatile variable optimizations
       [not found] <bug-18617-9497@http.gcc.gnu.org/bugzilla/>
  2009-02-08 14:13 ` steven at gcc dot gnu dot org
@ 2010-01-29 17:50 ` eric dot weddington at atmel dot com
  1 sibling, 0 replies; 7+ messages in thread
From: eric dot weddington at atmel dot com @ 2010-01-29 17:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from eric dot weddington at atmel dot com  2010-01-29 17:50 -------
Closing as WONTFIX.


-- 

eric dot weddington at atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |WONTFIX


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


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

* [Bug target/18617] missed volatile variable optimizations
       [not found] <bug-18617-9497@http.gcc.gnu.org/bugzilla/>
@ 2009-02-08 14:13 ` steven at gcc dot gnu dot org
  2010-01-29 17:50 ` eric dot weddington at atmel dot com
  1 sibling, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-02-08 14:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from steven at gcc dot gnu dot org  2009-02-08 14:13 -------
This is a really old bug.  Since 2005, a lot has happened in GCC.  Could
someone interested in AVR please check whether this is still an issue?


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

end of thread, other threads:[~2010-01-29 17:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-22 23:48 [Bug c/18617] New: missed volatile variable optimizations schlie at comcast dot net
2004-11-22 23:56 ` [Bug target/18617] " pinskia at gcc dot gnu dot org
2004-11-23 13:49 ` schlie at comcast dot net
2005-01-20  2:36 ` pinskia at gcc dot gnu dot org
2005-06-19 14:52 ` pinskia at gcc dot gnu dot org
     [not found] <bug-18617-9497@http.gcc.gnu.org/bugzilla/>
2009-02-08 14:13 ` steven at gcc dot gnu dot org
2010-01-29 17:50 ` eric dot weddington at atmel dot com

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).