This is the mail archive of the gcc@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]

Bug of feature? (fwd)




I got this report from an RTEMS user.  The test1 case does appear to be
guilty of not initializing "i" but the code is definitely unexpected.

--joel
Joel Sherrill                    Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985




---------- Forwarded message ----------
Date: Mon, 30 Nov 1998 10:07:19 +0100
From: Peter Mueller <pmueller@decrc.abb.de>
To: joel@oarcorp.com
Subject: Bug of feature?

Hello,
i'm using egcs for rtems application programming. I found an unexpected
behaviour during debugging. See below

Peter Mueller


The VERSION file reads:
"
 GCC      -  egcs-1.1b
 BINUTILS -  binutils-2.9.1
 NEWLIB   -  newlib-1.8.0
 TARGET   -  m68k-rtems
 INSTALL POINT -
/usr/local/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/m68k-rtems

 Patches may be installed "

------ test.c -----
/* Assumed Bug with "volatile" in egcs-2.91.57

   gcc-x86 always o.k.
   gcc-m68k -S -c -O3 test.c  o.k.
   gcc-m68k -S -c test.c      bug as below

 */

#define SCDR            (volatile unsigned short int *)(0x0e + 0xfffc00)

#define SCDR_novolatile (         unsigned short int *)(0x0e + 0xfffc00)

void test1(void) { int i; *SCDR            = i; }     /* bad   */
void test2(void) { int i; *SCDR            = 1234; }  /* good  */
void test3(void) { int i; *SCDR_novolatile = i; }     /* good  */
void test4(void) { int i; *SCDR_novolatile = 1234; }  /* good  */
------ end of file test.c -----

------ test.s ------
 .file "test.c"
gcc2_compiled.:
__gnu_compiled_c:
.text
 .even
.globl test1
test1:
 link.w %a6,#-4
 move.w -2(%a6),16776206
 move.w 16776206,16776206   ; !!! this line is not supposed to be here !

.L1:
 unlk %a6
 rts
 .even
.globl test2
test2:
 link.w %a6,#-4
 move.w #1234,16776206
.L2:
 unlk %a6
 rts
 .even
.globl test3
test3:
 link.w %a6,#-4
 move.w -2(%a6),16776206
.L3:
 unlk %a6
 rts
 .even
.globl test4
test4:
 link.w %a6,#-4
 move.w #1234,16776206
.L4:
 unlk %a6
 rts
----- end of file test.s -----





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